com.jme3.bullet.objects
クラス PhysicsRigidBody

java.lang.Object
  上位を拡張 com.jme3.bullet.collision.PhysicsCollisionObject
      上位を拡張 com.jme3.bullet.objects.PhysicsRigidBody
すべての実装されたインタフェース:
Savable
直系の既知のサブクラス:
PhysicsVehicle, RigidBodyControl

public class PhysicsRigidBody
extends PhysicsCollisionObject

PhysicsRigidBody - Basic physics object


フィールドの概要
 
クラス com.jme3.bullet.collision.PhysicsCollisionObject から継承されたフィールド
COLLISION_GROUP_01, COLLISION_GROUP_02, COLLISION_GROUP_03, COLLISION_GROUP_04, COLLISION_GROUP_05, COLLISION_GROUP_06, COLLISION_GROUP_07, COLLISION_GROUP_08, COLLISION_GROUP_09, COLLISION_GROUP_10, COLLISION_GROUP_11, COLLISION_GROUP_12, COLLISION_GROUP_13, COLLISION_GROUP_14, COLLISION_GROUP_15, COLLISION_GROUP_16, COLLISION_GROUP_NONE
 
コンストラクタの概要
PhysicsRigidBody()
           
PhysicsRigidBody(CollisionShape shape)
          Creates a new PhysicsRigidBody with the supplied collision shape
PhysicsRigidBody(CollisionShape shape, float mass)
           
 
メソッドの概要
 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.
 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.
 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.
 void applyTorqueImpulse(Vector3f vec)
          Apply a torque impulse to the PhysicsRigidBody in the next physics update.
 void clearForces()
          Clear all forces from the PhysicsRigidBody
 void destroy()
          destroys this PhysicsRigidBody and removes it from memory
 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()
           
 float getFriction()
           
 Vector3f getGravity()
           
 Vector3f getGravity(Vector3f gravity)
           
 Vector3f getInterpolatedPhysicsLocation(Vector3f location)
          Gets the physics object location
 Matrix3f getInterpolatedPhysicsRotation(Matrix3f rotation)
          Gets the physics object rotation
 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()
           
 com.bulletphysics.dynamics.RigidBody getObjectId()
          used internally
 Vector3f getPhysicsLocation()
          Gets the physics object location, instantiates a new Vector3f object
 Vector3f getPhysicsLocation(Vector3f location)
          Gets the physics object location, no object instantiation
 Quaternion getPhysicsRotation()
          Gets the physics object rotation as a quaternion, converts the bullet Matrix3f value, instantiates new object
 Quaternion getPhysicsRotation(Quaternion rotation)
          Gets the physics object rotation as a quaternion, converts the bullet Matrix3f value
 Matrix3f getPhysicsRotationMatrix()
          Gets the physics object rotation
 Matrix3f getPhysicsRotationMatrix(Matrix3f rotation)
          Gets the physics object rotation as a matrix, no conversions and no object instantiation
 float getRestitution()
           
 boolean isActive()
           
 boolean isKinematic()
           
 void read(JmeImporter e)
           
 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. in this mode the node is not affected by physics but affects other physics objects.
 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)
           
 
クラス com.jme3.bullet.collision.PhysicsCollisionObject から継承されたメソッド
addCollideWithGroup, createDebugShape, debugShape, detachDebugShape, getCollideWithGroups, getCollisionGroup, getCollisionShape, getUserObject, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObject
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

PhysicsRigidBody

public PhysicsRigidBody()

PhysicsRigidBody

public PhysicsRigidBody(CollisionShape shape)
Creates a new PhysicsRigidBody with the supplied collision shape

パラメータ:
child -
shape -

PhysicsRigidBody

public PhysicsRigidBody(CollisionShape shape,
                        float mass)
メソッドの詳細

getMotionState

public RigidBodyMotionState getMotionState()
戻り値:
the motionState

setPhysicsLocation

public void setPhysicsLocation(Vector3f location)
Sets the physics object location

パラメータ:
location - the location of the actual physics object

setPhysicsRotation

public void setPhysicsRotation(Matrix3f rotation)
Sets the physics object rotation

パラメータ:
rotation - the rotation of the actual physics object

setPhysicsRotation

public void setPhysicsRotation(Quaternion rotation)
Sets the physics object rotation

パラメータ:
rotation - the rotation of the actual physics object

getPhysicsLocation

public Vector3f getPhysicsLocation()
Gets the physics object location, instantiates a new Vector3f object

パラメータ:
location - the location of the actual physics object is stored in this Vector3f

getPhysicsRotationMatrix

public Matrix3f getPhysicsRotationMatrix()
Gets the physics object rotation

パラメータ:
rotation - the rotation of the actual physics object is stored in this Matrix3f

getPhysicsLocation

public Vector3f getPhysicsLocation(Vector3f location)
Gets the physics object location, no object instantiation

パラメータ:
location - the location of the actual physics object is stored in this Vector3f

getPhysicsRotationMatrix

public Matrix3f getPhysicsRotationMatrix(Matrix3f rotation)
Gets the physics object rotation as a matrix, no conversions and no object instantiation

パラメータ:
rotation - the rotation of the actual physics object is stored in this Matrix3f

getPhysicsRotation

public Quaternion getPhysicsRotation()
Gets the physics object rotation as a quaternion, converts the bullet Matrix3f value, instantiates new object

パラメータ:
rotation - the rotation of the actual physics object is stored in this Quaternion

getPhysicsRotation

public Quaternion getPhysicsRotation(Quaternion rotation)
Gets the physics object rotation as a quaternion, converts the bullet Matrix3f value

パラメータ:
rotation - the rotation of the actual physics object is stored in this Quaternion

getInterpolatedPhysicsLocation

public Vector3f getInterpolatedPhysicsLocation(Vector3f location)
Gets the physics object location

パラメータ:
location - the location of the actual physics object is stored in this Vector3f

getInterpolatedPhysicsRotation

public Matrix3f getInterpolatedPhysicsRotation(Matrix3f rotation)
Gets the physics object rotation

パラメータ:
rotation - the rotation of the actual physics object is stored in this Matrix3f

setKinematic

public void setKinematic(boolean kinematic)
Sets the node to kinematic mode. in this mode the node is not affected by physics but affects other physics objects. Iits kinetic force is calculated by the amount of movement it is exposed to and its weight.

パラメータ:
kinematic -

isKinematic

public boolean isKinematic()

setCcdSweptSphereRadius

public void setCcdSweptSphereRadius(float radius)

setCcdMotionThreshold

public 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)

パラメータ:
threshold -

getCcdSweptSphereRadius

public float getCcdSweptSphereRadius()

getCcdMotionThreshold

public float getCcdMotionThreshold()

getCcdSquareMotionThreshold

public float getCcdSquareMotionThreshold()

getMass

public float getMass()

setMass

public void setMass(float mass)
Sets the mass of this PhysicsRigidBody, objects with mass=0 are static.

パラメータ:
mass -

getGravity

public Vector3f getGravity()

getGravity

public Vector3f getGravity(Vector3f gravity)

setGravity

public 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.

パラメータ:
gravity - the gravity vector to set

getFriction

public float getFriction()

setFriction

public void setFriction(float friction)
Sets the friction of this physics object

パラメータ:
friction - the friction of this physics object

setDamping

public void setDamping(float linearDamping,
                       float angularDamping)

setLinearDamping

public void setLinearDamping(float linearDamping)

setAngularDamping

public void setAngularDamping(float angularDamping)

getLinearDamping

public float getLinearDamping()

getAngularDamping

public float getAngularDamping()

getRestitution

public float getRestitution()

setRestitution

public void setRestitution(float restitution)
The "bouncyness" of the PhysicsRigidBody, best performance if restitution=0

パラメータ:
restitution -

getAngularVelocity

public Vector3f getAngularVelocity()
Get the current angular velocity of this PhysicsRigidBody

戻り値:
the current linear velocity

getAngularVelocity

public void getAngularVelocity(Vector3f vec)
Get the current angular velocity of this PhysicsRigidBody

パラメータ:
vec - the vector to store the velocity in

setAngularVelocity

public void setAngularVelocity(Vector3f vec)
Sets the angular velocity of this PhysicsRigidBody

パラメータ:
vec - the angular velocity of this PhysicsRigidBody

getLinearVelocity

public Vector3f getLinearVelocity()
Get the current linear velocity of this PhysicsRigidBody

戻り値:
the current linear velocity

getLinearVelocity

public void getLinearVelocity(Vector3f vec)
Get the current linear velocity of this PhysicsRigidBody

パラメータ:
vec - the vector to store the velocity in

setLinearVelocity

public void setLinearVelocity(Vector3f vec)
Sets the linear velocity of this PhysicsRigidBody

パラメータ:
vec - the linear velocity of this PhysicsRigidBody

applyForce

public 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.

パラメータ:
force - the force
location - the location of the force

applyCentralForce

public 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.

パラメータ:
force - the force

applyTorque

public 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.

パラメータ:
torque - the torque

applyImpulse

public void applyImpulse(Vector3f impulse,
                         Vector3f rel_pos)
Apply an impulse to the PhysicsRigidBody in the next physics update.

パラメータ:
impulse - applied impulse
rel_pos - location relative to object

applyTorqueImpulse

public void applyTorqueImpulse(Vector3f vec)
Apply a torque impulse to the PhysicsRigidBody in the next physics update.

パラメータ:
vec -

clearForces

public void clearForces()
Clear all forces from the PhysicsRigidBody


setCollisionShape

public void setCollisionShape(CollisionShape collisionShape)
クラス PhysicsCollisionObject の記述:
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.

オーバーライド:
クラス PhysicsCollisionObject 内の setCollisionShape
パラメータ:
collisionShape - the CollisionShape to set

activate

public void activate()
reactivates this PhysicsRigidBody when it has been deactivated because it was not moving


isActive

public boolean isActive()

setSleepingThresholds

public void setSleepingThresholds(float linear,
                                  float angular)
sets the sleeping thresholds, these define when the object gets deactivated to save ressources. Low values keep the object active when it barely moves

パラメータ:
linear - the linear sleeping threshold
angular - the angular sleeping threshold

setLinearSleepingThreshold

public void setLinearSleepingThreshold(float linearSleepingThreshold)

setAngularSleepingThreshold

public void setAngularSleepingThreshold(float angularSleepingThreshold)

getLinearSleepingThreshold

public float getLinearSleepingThreshold()

getAngularSleepingThreshold

public float getAngularSleepingThreshold()

getAngularFactor

public float getAngularFactor()

setAngularFactor

public void setAngularFactor(float factor)

addJoint

public void addJoint(PhysicsJoint joint)
do not use manually, joints are added automatically


removeJoint

public void removeJoint(PhysicsJoint joint)

getJoints

public java.util.List<PhysicsJoint> getJoints()
Returns a list of connected joints. This list is only filled when the PhysicsRigidBody is actually added to the physics space or loaded from disk.

戻り値:
list of active joints connected to this PhysicsRigidBody

getObjectId

public com.bulletphysics.dynamics.RigidBody getObjectId()
used internally


destroy

public void destroy()
destroys this PhysicsRigidBody and removes it from memory


write

public void write(JmeExporter e)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス PhysicsCollisionObject 内の write
例外:
java.io.IOException

read

public void read(JmeImporter e)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス PhysicsCollisionObject 内の read
例外:
java.io.IOException