Skip to content
Alessandro Febretti edited this page May 16, 2014 · 11 revisions

Last revision: ver. 5.1 - 5 November 2013

module cyclops

RigidBody is the interface between entities and the Bullet Physics engine.

Methods

Method(s) Description
setEnabled(bool value), bool isEnabled() Enables or disables physics simulation on this rigid body. Simulation is disabled by default.
initialize(RigidBodyType type, float mass) Initializes this rigibdoby using the specified type and mass. More about RigidBodyType in following section.
sync() Updates the rigid body transformation with the transformation coming from the owner entity. Useful after initializing a rigid body to place it to where the owner entity is, or to move around user-controlled rigid bodies.
applyForce(Vector3 force, Vector3 relPos) Applies a force vector to the specified point. Both the force and the point are specified as Vector3.
applyCentralForce(Vector3 force) Applies a force to the object center of mass. The force is specified as a Vector3.
applyImpulse(Vector3 impulse, Vector3 relPos) Applies an impulse vector to the specified point. Both the impulse and the point are specified as Vector3.
applyCentralImpulse(Vector3 impulse) Applies an impulse to the object center of mass. The impulse is specified as a Vector3.
setLinearVelocity(Vector3 linearVelocity) Sets the rigid body linear velocity as a Vector3.
setAngularVelocity(Vector3 angularVelocity) Sets the rigid body angular velocity as a Vector3.
setUserControlled(bool value), bool isUserControlled() If isUserControlled() is True, owner entity's transformation will not be automatically updated based on rigid body's transformation.
setFriction(float friction), float getFriction() Sets or gets friction for this object.
setRollingFriction(float friction), float getRollingFriction() Sets or gets the rolling friction for this object. Rolling friction prevents rounded shapes, such as spheres, cylinders and capsules from rolling forever.

The RigidBodyType Enumeration

Currently supported RigidBodyType include RigidBodyType.Box, RigidBodyType.Sphere and RigidBodyType. Plane

Clone this wiki locally