|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.bullet.collision.PhysicsCollisionObject
com.jme3.bullet.objects.PhysicsRigidBody
public class PhysicsRigidBody
PhysicsRigidBody - Basic physics object
Field Summary | |
---|---|
protected java.util.ArrayList<PhysicsJoint> |
joints
|
protected boolean |
kinematic
|
protected float |
mass
|
protected RigidBodyMotionState |
motionState
|
Constructor Summary | |
---|---|
PhysicsRigidBody()
|
|
PhysicsRigidBody(CollisionShape shape)
Creates a new PhysicsRigidBody with the supplied collision shape |
|
PhysicsRigidBody(CollisionShape shape,
float mass)
|
Method Summary | |
---|---|
void |
activate()
reactivates this PhysicsRigidBody when it has been deactivated because it was not moving |
void |
addJoint(PhysicsJoint joint)
do not use manually, joints are added automatically |
void |
applyCentralForce(Vector3f force)
Apply a force to the PhysicsRigidBody, only applies force if the next physics update call updates the physics space. To apply an impulse, use applyImpulse. |
void |
applyForce(Vector3f force,
Vector3f location)
Apply a force to the PhysicsRigidBody, only applies force if the next physics update call updates the physics space. To apply an impulse, use applyImpulse, use applyContinuousForce to apply continuous force. |
void |
applyImpulse(Vector3f impulse,
Vector3f rel_pos)
Apply an impulse to the PhysicsRigidBody in the next physics update. |
void |
applyTorque(Vector3f torque)
Apply a force to the PhysicsRigidBody, only applies force if the next physics update call updates the physics space. To apply an impulse, use applyImpulse. |
void |
applyTorqueImpulse(Vector3f vec)
Apply a torque impulse to the PhysicsRigidBody in the next physics update. |
void |
clearForces()
Clear all forces from the PhysicsRigidBody |
float |
getAngularDamping()
|
float |
getAngularFactor()
|
float |
getAngularSleepingThreshold()
|
Vector3f |
getAngularVelocity()
Get the current angular velocity of this PhysicsRigidBody |
void |
getAngularVelocity(Vector3f vec)
Get the current angular velocity of this PhysicsRigidBody |
float |
getCcdMotionThreshold()
|
float |
getCcdSquareMotionThreshold()
|
float |
getCcdSweptSphereRadius()
|
protected Spatial |
getDebugShape()
|
float |
getFriction()
|
Vector3f |
getGravity()
|
Vector3f |
getGravity(Vector3f gravity)
|
java.util.List<PhysicsJoint> |
getJoints()
Returns a list of connected joints. |
float |
getLinearDamping()
|
float |
getLinearSleepingThreshold()
|
Vector3f |
getLinearVelocity()
Get the current linear velocity of this PhysicsRigidBody |
void |
getLinearVelocity(Vector3f vec)
Get the current linear velocity of this PhysicsRigidBody |
float |
getMass()
|
RigidBodyMotionState |
getMotionState()
|
Vector3f |
getPhysicsLocation()
|
Vector3f |
getPhysicsLocation(Vector3f trans)
|
Quaternion |
getPhysicsRotation()
|
Quaternion |
getPhysicsRotation(Quaternion rot)
|
Matrix3f |
getPhysicsRotationMatrix()
|
Matrix3f |
getPhysicsRotationMatrix(Matrix3f rot)
|
float |
getRestitution()
|
boolean |
isActive()
|
boolean |
isInWorld()
|
boolean |
isKinematic()
|
protected void |
postRebuild()
|
protected void |
preRebuild()
|
void |
read(JmeImporter e)
|
protected void |
rebuildRigidBody()
Builds/rebuilds the phyiscs body when parameters have changed |
void |
removeJoint(PhysicsJoint joint)
|
void |
setAngularDamping(float angularDamping)
|
void |
setAngularFactor(float factor)
|
void |
setAngularSleepingThreshold(float angularSleepingThreshold)
|
void |
setAngularVelocity(Vector3f vec)
Sets the angular velocity of this PhysicsRigidBody |
void |
setCcdMotionThreshold(float threshold)
Sets the amount of motion that has to happen in one physics tick to trigger the continuous motion detection This avoids the problem of fast objects moving through other objects, set to zero to disable (default) |
void |
setCcdSweptSphereRadius(float radius)
|
void |
setCollisionShape(CollisionShape collisionShape)
Sets a CollisionShape to this physics object, note that the object should not be in the physics space when adding a new collision shape as it is rebuilt on the physics side. |
void |
setDamping(float linearDamping,
float angularDamping)
|
void |
setFriction(float friction)
Sets the friction of this physics object |
void |
setGravity(Vector3f gravity)
Set the local gravity of this PhysicsRigidBody Set this after adding the node to the PhysicsSpace, the PhysicsSpace assigns its current gravity to the physics node when its added. |
void |
setKinematic(boolean kinematic)
Sets the node to kinematic mode. |
void |
setLinearDamping(float linearDamping)
|
void |
setLinearSleepingThreshold(float linearSleepingThreshold)
|
void |
setLinearVelocity(Vector3f vec)
Sets the linear velocity of this PhysicsRigidBody |
void |
setMass(float mass)
Sets the mass of this PhysicsRigidBody, objects with mass=0 are static. |
void |
setPhysicsLocation(Vector3f location)
Sets the physics object location |
void |
setPhysicsRotation(Matrix3f rotation)
Sets the physics object rotation |
void |
setPhysicsRotation(Quaternion rotation)
Sets the physics object rotation |
void |
setRestitution(float restitution)
The "bouncyness" of the PhysicsRigidBody, best performance if restitution=0 |
void |
setSleepingThresholds(float linear,
float angular)
sets the sleeping thresholds, these define when the object gets deactivated to save ressources. |
void |
write(JmeExporter e)
|
Methods inherited from class com.jme3.bullet.collision.PhysicsCollisionObject |
---|
addCollideWithGroup, attachCollisionShape, attachDebugShape, attachDebugShape, attachDebugShape, createDebugShape, debugShape, detachDebugShape, finalize, finalizeNative, getCollideWithGroups, getCollisionGroup, getCollisionShape, getObjectId, getUserObject, initUserPointer, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObject, updateDebugShape |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RigidBodyMotionState motionState
protected float mass
protected boolean kinematic
protected java.util.ArrayList<PhysicsJoint> joints
Constructor Detail |
---|
public PhysicsRigidBody()
public PhysicsRigidBody(CollisionShape shape)
child
- shape
- public PhysicsRigidBody(CollisionShape shape, float mass)
Method Detail |
---|
protected void rebuildRigidBody()
protected void preRebuild()
protected void postRebuild()
public RigidBodyMotionState getMotionState()
public boolean isInWorld()
public void setPhysicsLocation(Vector3f location)
location
- the location of the actual physics objectpublic void setPhysicsRotation(Matrix3f rotation)
rotation
- the rotation of the actual physics objectpublic void setPhysicsRotation(Quaternion rotation)
rotation
- the rotation of the actual physics objectpublic Vector3f getPhysicsLocation(Vector3f trans)
public Quaternion getPhysicsRotation(Quaternion rot)
public Matrix3f getPhysicsRotationMatrix(Matrix3f rot)
public Vector3f getPhysicsLocation()
public Quaternion getPhysicsRotation()
public Matrix3f getPhysicsRotationMatrix()
public void setKinematic(boolean kinematic)
kinematic
- public boolean isKinematic()
public void setCcdSweptSphereRadius(float radius)
public void setCcdMotionThreshold(float threshold)
threshold
- public float getCcdSweptSphereRadius()
public float getCcdMotionThreshold()
public float getCcdSquareMotionThreshold()
public float getMass()
public void setMass(float mass)
mass
- public Vector3f getGravity()
public Vector3f getGravity(Vector3f gravity)
public void setGravity(Vector3f gravity)
gravity
- the gravity vector to setpublic float getFriction()
public void setFriction(float friction)
friction
- the friction of this physics objectpublic void setDamping(float linearDamping, float angularDamping)
public void setLinearDamping(float linearDamping)
public void setAngularDamping(float angularDamping)
public float getLinearDamping()
public float getAngularDamping()
public float getRestitution()
public void setRestitution(float restitution)
restitution
- public Vector3f getAngularVelocity()
public void getAngularVelocity(Vector3f vec)
vec
- the vector to store the velocity inpublic void setAngularVelocity(Vector3f vec)
vec
- the angular velocity of this PhysicsRigidBodypublic Vector3f getLinearVelocity()
public void getLinearVelocity(Vector3f vec)
vec
- the vector to store the velocity inpublic void setLinearVelocity(Vector3f vec)
vec
- the linear velocity of this PhysicsRigidBodypublic void applyForce(Vector3f force, Vector3f location)
force
- the forcelocation
- the location of the forcepublic void applyCentralForce(Vector3f force)
force
- the forcepublic void applyTorque(Vector3f torque)
torque
- the torquepublic void applyImpulse(Vector3f impulse, Vector3f rel_pos)
impulse
- applied impulserel_pos
- location relative to objectpublic void applyTorqueImpulse(Vector3f vec)
vec
- public void clearForces()
public void setCollisionShape(CollisionShape collisionShape)
PhysicsCollisionObject
setCollisionShape
in class PhysicsCollisionObject
collisionShape
- the CollisionShape to setpublic void activate()
public boolean isActive()
public void setSleepingThresholds(float linear, float angular)
linear
- the linear sleeping thresholdangular
- the angular sleeping thresholdpublic void setLinearSleepingThreshold(float linearSleepingThreshold)
public void setAngularSleepingThreshold(float angularSleepingThreshold)
public float getLinearSleepingThreshold()
public float getAngularSleepingThreshold()
public float getAngularFactor()
public void setAngularFactor(float factor)
public void addJoint(PhysicsJoint joint)
public void removeJoint(PhysicsJoint joint)
public java.util.List<PhysicsJoint> getJoints()
protected Spatial getDebugShape()
getDebugShape
in class PhysicsCollisionObject
public void write(JmeExporter e) throws java.io.IOException
write
in interface Savable
write
in class PhysicsCollisionObject
java.io.IOException
public void read(JmeImporter e) throws java.io.IOException
read
in interface Savable
read
in class PhysicsCollisionObject
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |