|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bulletphysics.collision.dispatch.CollisionObject
com.bulletphysics.dynamics.RigidBody
public class RigidBody
RigidBody is the main class for rigid body objects. It is derived from
CollisionObject
, so it keeps reference to CollisionShape
.
It is recommended for performance and memory use to share CollisionShape
objects whenever possible.
There are 3 types of rigid bodies:
Deactivated (sleeping) rigid bodies don't take any processing time, except a minor broadphase collision detection impact (to allow active objects to activate/wake up sleeping objects).
Field Summary | |
---|---|
int |
contactSolverType
|
int |
debugBodyId
|
int |
frictionSolverType
|
Fields inherited from class com.bulletphysics.collision.dispatch.CollisionObject |
---|
ACTIVE_TAG, DISABLE_DEACTIVATION, DISABLE_SIMULATION, ISLAND_SLEEPING, WANTS_DEACTIVATION |
Constructor Summary | |
---|---|
RigidBody(float mass,
MotionState motionState,
CollisionShape collisionShape)
|
|
RigidBody(float mass,
MotionState motionState,
CollisionShape collisionShape,
Vector3f localInertia)
|
|
RigidBody(RigidBodyConstructionInfo constructionInfo)
|
Method Summary | |
---|---|
void |
addConstraintRef(TypedConstraint c)
|
void |
applyCentralForce(Vector3f force)
|
void |
applyCentralImpulse(Vector3f impulse)
|
void |
applyDamping(float timeStep)
Damps the velocity, using the given linearDamping and angularDamping. |
void |
applyForce(Vector3f force,
Vector3f rel_pos)
|
void |
applyGravity()
|
void |
applyImpulse(Vector3f impulse,
Vector3f rel_pos)
|
void |
applyTorque(Vector3f torque)
|
void |
applyTorqueImpulse(Vector3f torque)
|
void |
clearForces()
|
float |
computeAngularImpulseDenominator(Vector3f axis)
|
float |
computeImpulseDenominator(Vector3f pos,
Vector3f normal)
|
void |
destroy()
|
void |
getAabb(Vector3f aabbMin,
Vector3f aabbMax)
|
float |
getAngularFactor()
|
Vector3f |
getAngularVelocity(Vector3f out)
|
BroadphaseProxy |
getBroadphaseProxy()
|
Vector3f |
getCenterOfMassPosition(Vector3f out)
|
Transform |
getCenterOfMassTransform(Transform out)
|
TypedConstraint |
getConstraintRef(int index)
|
Vector3f |
getGravity(Vector3f out)
|
Vector3f |
getInvInertiaDiagLocal(Vector3f out)
|
Matrix3f |
getInvInertiaTensorWorld(Matrix3f out)
|
float |
getInvMass()
|
Vector3f |
getLinearVelocity(Vector3f out)
|
MotionState |
getMotionState()
|
int |
getNumConstraintRefs()
|
Quat4f |
getOrientation(Quat4f out)
|
Vector3f |
getVelocityInLocalPoint(Vector3f rel_pos,
Vector3f out)
|
boolean |
checkCollideWithOverride(CollisionObject co)
|
void |
integrateVelocities(float step)
|
void |
internalApplyImpulse(Vector3f linearComponent,
Vector3f angularComponent,
float impulseMagnitude)
Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position. |
boolean |
isInWorld()
Is this rigidbody added to a CollisionWorld/DynamicsWorld/Broadphase? |
void |
predictIntegratedTransform(float timeStep,
Transform predictedTransform)
Continuous collision detection needs prediction. |
void |
proceedToTransform(Transform newTrans)
|
void |
removeConstraintRef(TypedConstraint c)
|
void |
saveKinematicState(float timeStep)
|
void |
setAngularFactor(float angFac)
|
void |
setAngularVelocity(Vector3f ang_vel)
|
void |
setCenterOfMassTransform(Transform xform)
|
void |
setDamping(float lin_damping,
float ang_damping)
|
void |
setGravity(Vector3f acceleration)
|
void |
setInvInertiaDiagLocal(Vector3f diagInvInertia)
|
void |
setLinearVelocity(Vector3f lin_vel)
|
void |
setMassProps(float mass,
Vector3f inertia)
|
void |
setMotionState(MotionState motionState)
|
void |
setNewBroadphaseProxy(BroadphaseProxy broadphaseProxy)
|
void |
setSleepingThresholds(float linear,
float angular)
|
void |
translate(Vector3f v)
|
static RigidBody |
upcast(CollisionObject colObj)
To keep collision detection and dynamics separate we don't store a rigidbody pointer, but a rigidbody is derived from CollisionObject, so we can safely perform an upcast. |
void |
updateDeactivation(float timeStep)
|
void |
updateInertiaTensor()
|
boolean |
wantsSleeping()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int contactSolverType
public int frictionSolverType
public int debugBodyId
Constructor Detail |
---|
public RigidBody(RigidBodyConstructionInfo constructionInfo)
public RigidBody(float mass, MotionState motionState, CollisionShape collisionShape)
public RigidBody(float mass, MotionState motionState, CollisionShape collisionShape, Vector3f localInertia)
Method Detail |
---|
public void destroy()
public void proceedToTransform(Transform newTrans)
public static RigidBody upcast(CollisionObject colObj)
public void predictIntegratedTransform(float timeStep, Transform predictedTransform)
public void saveKinematicState(float timeStep)
public void applyGravity()
public void setGravity(Vector3f acceleration)
public Vector3f getGravity(Vector3f out)
public void setDamping(float lin_damping, float ang_damping)
public void applyDamping(float timeStep)
public void setMassProps(float mass, Vector3f inertia)
public float getInvMass()
public Matrix3f getInvInertiaTensorWorld(Matrix3f out)
public void integrateVelocities(float step)
public void setCenterOfMassTransform(Transform xform)
public void applyCentralForce(Vector3f force)
public Vector3f getInvInertiaDiagLocal(Vector3f out)
public void setInvInertiaDiagLocal(Vector3f diagInvInertia)
public void setSleepingThresholds(float linear, float angular)
public void applyTorque(Vector3f torque)
public void applyForce(Vector3f force, Vector3f rel_pos)
public void applyCentralImpulse(Vector3f impulse)
public void applyTorqueImpulse(Vector3f torque)
public void applyImpulse(Vector3f impulse, Vector3f rel_pos)
public void internalApplyImpulse(Vector3f linearComponent, Vector3f angularComponent, float impulseMagnitude)
public void clearForces()
public void updateInertiaTensor()
public Vector3f getCenterOfMassPosition(Vector3f out)
public Quat4f getOrientation(Quat4f out)
public Transform getCenterOfMassTransform(Transform out)
public Vector3f getLinearVelocity(Vector3f out)
public Vector3f getAngularVelocity(Vector3f out)
public void setLinearVelocity(Vector3f lin_vel)
public void setAngularVelocity(Vector3f ang_vel)
public Vector3f getVelocityInLocalPoint(Vector3f rel_pos, Vector3f out)
public void translate(Vector3f v)
public void getAabb(Vector3f aabbMin, Vector3f aabbMax)
public float computeImpulseDenominator(Vector3f pos, Vector3f normal)
public float computeAngularImpulseDenominator(Vector3f axis)
public void updateDeactivation(float timeStep)
public boolean wantsSleeping()
public BroadphaseProxy getBroadphaseProxy()
public void setNewBroadphaseProxy(BroadphaseProxy broadphaseProxy)
public MotionState getMotionState()
public void setMotionState(MotionState motionState)
public void setAngularFactor(float angFac)
public float getAngularFactor()
public boolean isInWorld()
public boolean checkCollideWithOverride(CollisionObject co)
checkCollideWithOverride
in class CollisionObject
public void addConstraintRef(TypedConstraint c)
public void removeConstraintRef(TypedConstraint c)
public TypedConstraint getConstraintRef(int index)
public int getNumConstraintRefs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |