Class PhysicsShape
Hierarchy
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Constructs a new physics shape.
Parameters
options: PhysicShapeOptions
The options for the physics shape. These are:
- type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER
- parameters: The parameters of the shape.
- pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side. You need to specify either type or pluginData.
scene: Scene
The scene the shape belongs to.
This code is useful for creating a new physics shape with the given type, options, and scene. It also checks that the physics engine and plugin version are correct. If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.
Returns PhysicsShape
Properties
_plugin DataSearch playground for _pluginData
V2 Physics plugin private data for single shape
Accessors
type
Returns ShapeType
Methods
add ChildSearch playground for addChild
Parameters
newChild: PhysicsShape
childTransform: TransformNode
Returns void
disposeSearch playground for dispose
Returns void
get Bounding BoxSearch playground for getBoundingBox
Returns BoundingBox
get DensitySearch playground for getDensity
Returns number
get Filter LayerSearch playground for getFilterLayer
Returns number
get MaterialSearch playground for getMaterial
Returns undefined | PhysicsMaterial
get Num ChildrenSearch playground for getNumChildren
Returns number
remove ChildSearch playground for removeChild
Parameters
childIndex: number
Returns void
set DensitySearch playground for setDensity
Parameters
density: number
Returns void
set Filter LayerSearch playground for setFilterLayer
Parameters
layer: number
Returns void
set MaterialSearch playground for setMaterial
Parameters
material: PhysicsMaterial
Returns void
PhysicsShape class. This class is useful for creating a physics shape that can be used in a physics engine. A Physic Shape determine how collision are computed. It must be attached to a body.