Returns the Rapier rigid body attached to this Wordcore object.
Create a new rigid body for this object. Deletes any previous rigid body and its attached colliders. An object can only have one rigid body at a time. The position of the rigid body is taken from the position of the object at the moment that it's created. Takes as its argument a Rapier rigid body description (see the Rapier docs for more information.)
- Static - Doesn't move
- Dynamic - Position controlled by simulation
- KinematicPositionBased - Position controlled by user
A Rapier rigid body description.
Deletes the object's current rigid body and any attached colliders. Called automatically when the actor is destroyed.
Create a new collider and attaches it to the object's rigid body. Objects can have multiple colliders at the same time. Takes as its argument a Rapier collider description (see the Rapier docs for more information.)
const cd = RAPIER.ColliderDesc.cuboid(0.5, 0.5, 0.5); cd.setRestitution(0.5); cd.setFriction(0.8); cd.setDensity(2.5); this.createCollider(cd);