A shape is a component of a rigid body. It attaches a collision geometry to the parent rigid body with some physical properties such as coefficients of friction and restitution. The collision geometry can locally be transformed relative to the parent rigid body's center of gravity.
Constructor
Variables
Methods
inlinegetAabb():Aabb
Returns the AABB of the shape. The AABB may be incorrect if the shape doesn't have a parent rigid body.
inlinegetAabbTo(aabb:Aabb):Void
Sets aabb
to the AABB of the shape. The AABB may be incorrect if the shape doesn't have a
parent rigid body.
This does not create a new instance of AABB
.
inlinegetLocalTransform():Transform
Returns the transform of the shape relative to the parent rigid body's transform.
inlinegetLocalTransformTo(transform:Transform):Void
Sets transform
to the transform of the shape relative to the parent rigid body's
transform.
This does not create a new instance of Transform
.
inlinegetNext():Shape
Returns the next shape in the rigid body.
If the next one does not exist, null
will be returned.
inlinegetPrev():Shape
Returns the previous shape in the rigid body.
If the previous one does not exist, null
will be returned.
inlinegetRigidBody():RigidBody
Returns the parent rigid body. This returns null
if the shape doesn't have a parent
rigid body.
inlinegetTransformTo(transform:Transform):Void
Sets transform
to the world transform of the shape.
This does not create a new instance of Transform
.
inlinesetCollisionGroup(collisionGroup:Int):Void
Sets the shape's collision group bits to collisionGroup
.
inlinesetCollisionMask(collisionMask:Int):Void
Sets the shape's collision mask bits to collisionMask
.
inlinesetContactCallback(callback:ContactCallback):Void
Sets the contact callback of the shape to callback
.
inlinesetDensity(density:Float):Void
Sets the density of the shape to density
.
This affects the parent rigid body's mass data.
inlinesetLocalTransform(transform:Transform):Void
Sets the shape's transform to transform
relative to the parent rigid body's transform.
This affects the parent rigid body's mass data.