Class PhysicsShapeCylinder
Hierarchy
- PhysicsShape
- PhysicsShapeCylinder
Index
Constructors
constructor
Parameters
pointA: Vector3
Starting point that defines the cylinder segment
pointB: Vector3
ending point of that same segment
radius: number
radius
scene: Scene
scene to attach to
Returns PhysicsShapeCylinder
Properties
_plugin DataSearch playground for _pluginData
V2 Physics plugin private data for single shape
Accessors
density
Returns the density of the physics shape.
Returns number
The density of the physics shape.
Sets the density of the physics shape.
Parameters
density: number
The density of the physics shape.
Returns void
filter Collide Mask
Sets the collide mask of a shape. This is a bitfield of arbitrary "categories" to which this shape collides with. Given two shapes, the engine will check if the collide mask and membership overlap: shapeA.filterMembershipMask & shapeB.filterCollideMask
If this value is zero (i.e. shapeB only collides with categories which shapeA is not a member of) then the shapes will not collide.
Note, the engine will also perform the same test with shapeA and shapeB swapped; the shapes will not collide if either shape has a collideMask which prevents collision with the other shape.
Returns number
Bitmask of categories that this shape should collide with
Sets the collide mask of a shape. This is a bitfield of arbitrary "categories" to which this shape collides with. Given two shapes, the engine will check if the collide mask and membership overlap: shapeA.filterMembershipMask & shapeB.filterCollideMask
If this value is zero (i.e. shapeB only collides with categories which shapeA is not a member of) then the shapes will not collide.
Note, the engine will also perform the same test with shapeA and shapeB swapped; the shapes will not collide if either shape has a collideMask which prevents collision with the other shape.
Parameters
collideMask: number
Bitmask of categories this shape should collide with
Returns void
filter Membership Mask
Get the membership mask of a shape.
Returns number
Bitmask of categories which this shape is a member of.
Set the membership mask of a shape. This is a bitfield of arbitrary "categories" to which the shape is a member. This is used in combination with the collide mask to determine if this shape should collide with another.
Parameters
membershipMask: number
Bitfield of categories of this shape.
Returns void
is Trigger
Returns boolean
Parameters
isTrigger: boolean
Returns void
material
Returns the material of the physics shape.
Returns PhysicsMaterial
The material of the physics shape.
Parameters
material: PhysicsMaterial
Returns void
type
Returns the type of the physics shape.
Returns PhysicsShapeType
The type of the physics shape.
Methods
add ChildSearch playground for addChild
Adds a child shape to a container with an optional transform
Parameters
newChild: PhysicsShape
The new PhysicsShape to add
Optional translation: Vector3
Optional position of the child shape relative to this shape
Optional rotation: Quaternion
Optional rotation of the child shape relative to this shape
Optional scale: Vector3
Optional scale of the child shape relative to this shape
Returns void
add Child From ParentSearch playground for addChildFromParent
Utility to add a child shape to this container, automatically computing the relative transform between the container shape and the child instance.
Parameters
parentTransform: TransformNode
The transform node associated with this shape
newChild: PhysicsShape
The new PhysicsShape to add
childTransform: TransformNode
The transform node associated with the child shape
Returns void
disposeSearch playground for dispose
Dispose the shape and release its associated resources.
Returns void
get Bounding BoxSearch playground for getBoundingBox
Returns the bounding box of the physics shape.
Returns BoundingBox
The bounding box of the physics shape.
get Class NameSearch playground for getClassName
Returns the string "PhysicsShape".
Returns string
"PhysicsShape"
get Num ChildrenSearch playground for getNumChildren
Returns the number of children of a physics shape.
Returns number
The number of children of a physics shape.
remove ChildSearch playground for removeChild
Removes a child shape from this shape.
Parameters
childIndex: number
The index of the child shape to remove
Returns void
Static From MeshSearch playground for FromMesh
Derive an approximate cylinder from the mesh. Note, this is not the optimal bounding cylinder.
Parameters
mesh: AbstractMesh
Node from which to derive a cylinder shape
Returns PhysicsShapeCylinder
Helper object to create a cylinder shape