-
Notifications
You must be signed in to change notification settings - Fork 26
RigidBody
Alessandro Febretti edited this page May 16, 2014
·
11 revisions
Last revision: ver. 5.1 - 5 November 2013
RigidBody is the interface between entities and the Bullet Physics engine.
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([[Vector]]3 force, [[Vector]]3 relPos) |
Applies a force vector to the specified point. Both the force and the point are specified as Vector3. |
applyCentralForce([[Vector]]3 force) |
Applies a force to the object center of mass. The force is specified as a Vector3. |
applyImpulse([[Vector]]3 impulse, [[Vector]]3 relPos) |
Applies an impulse vector to the specified point. Both the impulse and the point are specified as Vector3. |
applyCentralImpulse([[Vector]]3 impulse) |
Applies an impulse to the object center of mass. The impulse is specified as a Vector3. |
setLinearVelocity([[Vector]]3 linearVelocity) |
Sets the rigid body linear velocity as a Vector3. |
setAngularVelocity([[Vector]]3 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. |
Currently supported RigidBodyType
include RigidBodyType.Box
, RigidBodyType.Sphere
and RigidBodyType. Plane