com.jme3.bullet.control
クラス KinematicRagdollControl

java.lang.Object
  上位を拡張 com.jme3.bullet.control.KinematicRagdollControl
すべての実装されたインタフェース:
PhysicsCollisionListener, PhysicsControl, Savable, Control

public class KinematicRagdollControl
extends java.lang.Object
implements PhysicsControl, PhysicsCollisionListener

This control is still a WIP, use it at your own risk
To use this control you need a model with an AnimControl and a SkeletonControl.
This should be the case if you imported an animated model from Ogre or blender.
Note enabling/disabling the control add/removes it from the physic space

This control creates collision shapes for each bones of the skeleton when you call spatial.addControl(ragdollControl).

There are 2 modes for this control :


入れ子のクラスの概要
static class KinematicRagdollControl.Mode
           
 
コンストラクタの概要
KinematicRagdollControl()
          contruct a KinematicRagdollControl
KinematicRagdollControl(float weightThreshold)
           
KinematicRagdollControl(RagdollPreset preset)
           
KinematicRagdollControl(RagdollPreset preset, float weightThreshold)
           
 
メソッドの概要
 void addBoneName(java.lang.String name)
          Add a bone name to this control Using this method you can specify which bones of the skeleton will be used to build the collision shapes.
 void addCollisionListener(RagdollCollisionListener listener)
          add a
 void blendToKinematicMode(float blendTime)
          Smoothly blend from Ragdoll mode to Kinematic mode This is useful to blend ragdoll actual position to a keyframe animation for example
 Control cloneForSpatial(Spatial spatial)
          Creates a clone of the Control, the given Spatial is the cloned version of the spatial to which this control is attached to.
 void collision(PhysicsCollisionEvent event)
          For internal use only callback for collisionevent
 PhysicsRigidBody getBoneRigidBody(java.lang.String boneName)
          return the rigidBody associated to the given bone
 float getEventDispatchImpulseThreshold()
           
 SixDofJoint getJoint(java.lang.String boneName)
          Return the joint between the given bone and its parent.
 KinematicRagdollControl.Mode getMode()
          retruns the mode of this control
 PhysicsSpace getPhysicsSpace()
          returns the physic space
 float getTotalMass()
           
 float getWeightThreshold()
           
 boolean isEnabled()
          returns true if the control is enabled
 void read(JmeImporter im)
          de-serialize this control
 void reBuild()
          rebuild the ragdoll this is useful if you applied scale on the ragdoll after it's been initialized
 void render(RenderManager rm, ViewPort vp)
          For internal use only specific render for the ragdoll(if debugging)
 void setBoneCcdMotionThreshold(java.lang.String boneName, float value)
          推奨されていません。 use getBoneRigidBody(String BoneName).setCcdMotionThreshold(float) instead
 void setBoneCcdSweptSphereRadius(java.lang.String boneName, float value)
          推奨されていません。 use getBoneRigidBody(String BoneName).setCcdSweptSphereRadius(float) instead
 void setCcdMotionThreshold(float value)
          Set the CcdMotionThreshold of all the bone's rigidBodies of the ragdoll
 void setCcdSweptSphereRadius(float value)
          Set the CcdSweptSphereRadius of all the bone's rigidBodies of the ragdoll
 void setEnabled(boolean enabled)
          enable or disable the control note that if enabled is true and that the physic space has been set on the ragdoll, the ragdoll is added to the physic space if enabled is false the ragdoll is removed from physic space.
 void setEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold)
           
 void setJointLimit(java.lang.String boneName, float maxX, float minX, float maxY, float minY, float maxZ, float minZ)
          Set the joint limits for the joint between the given bone and its parent.
 void setKinematicMode()
          Set the control into Kinematic mode In theis mode, the collision shapes follow the movements of the skeleton, and can interact with physical environement
 void setPhysicsSpace(PhysicsSpace space)
          set the physic space to this ragdoll
 void setRagdollMode()
          Sets the control into Ragdoll mode The skeleton is entirely controlled by physics.
 void setRootMass(float rootMass)
           
 void setSpatial(Spatial model)
           
 void setWeightThreshold(float weightThreshold)
           
 void update(float tpf)
          Updates the control.
 void write(JmeExporter ex)
          serialize this control
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

KinematicRagdollControl

public KinematicRagdollControl()
contruct a KinematicRagdollControl


KinematicRagdollControl

public KinematicRagdollControl(float weightThreshold)

KinematicRagdollControl

public KinematicRagdollControl(RagdollPreset preset,
                               float weightThreshold)

KinematicRagdollControl

public KinematicRagdollControl(RagdollPreset preset)
メソッドの詳細

update

public void update(float tpf)
インタフェース Control の記述:
Updates the control. This should not be called from user code.

定義:
インタフェース Control 内の update
パラメータ:
tpf - Time per frame.

cloneForSpatial

public Control cloneForSpatial(Spatial spatial)
インタフェース Control の記述:
Creates a clone of the Control, the given Spatial is the cloned version of the spatial to which this control is attached to.

定義:
インタフェース Control 内の cloneForSpatial
戻り値:
A clone of this control for the spatial

reBuild

public void reBuild()
rebuild the ragdoll this is useful if you applied scale on the ragdoll after it's been initialized


setSpatial

public void setSpatial(Spatial model)
定義:
インタフェース Control 内の setSpatial
パラメータ:
model - the spatial to be controlled. This should not be called from user code.

addBoneName

public void addBoneName(java.lang.String name)
Add a bone name to this control Using this method you can specify which bones of the skeleton will be used to build the collision shapes.

パラメータ:
name -

setJointLimit

public void setJointLimit(java.lang.String boneName,
                          float maxX,
                          float minX,
                          float maxY,
                          float minY,
                          float maxZ,
                          float minZ)
Set the joint limits for the joint between the given bone and its parent. This method can't work before attaching the control to a spatial

パラメータ:
boneName - the name of the bone
maxX - the maximum rotation on the x axis (in radians)
minX - the minimum rotation on the x axis (in radians)
maxY - the maximum rotation on the y axis (in radians)
minY - the minimum rotation on the z axis (in radians)
maxZ - the maximum rotation on the z axis (in radians)
minZ - the minimum rotation on the z axis (in radians)

getJoint

public SixDofJoint getJoint(java.lang.String boneName)
Return the joint between the given bone and its parent. This return null if it's called before attaching the control to a spatial

パラメータ:
boneName - the name of the bone
戻り値:
the joint between the given bone and its parent

setEnabled

public void setEnabled(boolean enabled)
enable or disable the control note that if enabled is true and that the physic space has been set on the ragdoll, the ragdoll is added to the physic space if enabled is false the ragdoll is removed from physic space.

定義:
インタフェース PhysicsControl 内の setEnabled
定義:
インタフェース Control 内の setEnabled
パラメータ:
enabled -

isEnabled

public boolean isEnabled()
returns true if the control is enabled

定義:
インタフェース Control 内の isEnabled
戻り値:
関連項目:
Control.setEnabled(boolean)

render

public void render(RenderManager rm,
                   ViewPort vp)
For internal use only specific render for the ragdoll(if debugging)

定義:
インタフェース Control 内の render
パラメータ:
rm -
vp -

setPhysicsSpace

public void setPhysicsSpace(PhysicsSpace space)
set the physic space to this ragdoll

定義:
インタフェース PhysicsControl 内の setPhysicsSpace
パラメータ:
space -

getPhysicsSpace

public PhysicsSpace getPhysicsSpace()
returns the physic space

定義:
インタフェース PhysicsControl 内の getPhysicsSpace
戻り値:

write

public void write(JmeExporter ex)
           throws java.io.IOException
serialize this control

定義:
インタフェース Savable 内の write
パラメータ:
ex -
例外:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
de-serialize this control

定義:
インタフェース Savable 内の read
パラメータ:
im -
例外:
java.io.IOException

collision

public void collision(PhysicsCollisionEvent event)
For internal use only callback for collisionevent

定義:
インタフェース PhysicsCollisionListener 内の collision
パラメータ:
event -

blendToKinematicMode

public void blendToKinematicMode(float blendTime)
Smoothly blend from Ragdoll mode to Kinematic mode This is useful to blend ragdoll actual position to a keyframe animation for example

パラメータ:
blendTime - the blending time between ragdoll to anim.

setKinematicMode

public void setKinematicMode()
Set the control into Kinematic mode In theis mode, the collision shapes follow the movements of the skeleton, and can interact with physical environement


setRagdollMode

public void setRagdollMode()
Sets the control into Ragdoll mode The skeleton is entirely controlled by physics.


getMode

public KinematicRagdollControl.Mode getMode()
retruns the mode of this control

戻り値:

addCollisionListener

public void addCollisionListener(RagdollCollisionListener listener)
add a

パラメータ:
listener -

setRootMass

public void setRootMass(float rootMass)

getTotalMass

public float getTotalMass()

getWeightThreshold

public float getWeightThreshold()

setWeightThreshold

public void setWeightThreshold(float weightThreshold)

getEventDispatchImpulseThreshold

public float getEventDispatchImpulseThreshold()

setEventDispatchImpulseThreshold

public void setEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold)

setCcdMotionThreshold

public void setCcdMotionThreshold(float value)
Set the CcdMotionThreshold of all the bone's rigidBodies of the ragdoll

パラメータ:
value -
関連項目:
PhysicsRigidBody.setCcdMotionThreshold(float)

setCcdSweptSphereRadius

public void setCcdSweptSphereRadius(float value)
Set the CcdSweptSphereRadius of all the bone's rigidBodies of the ragdoll

パラメータ:
value -
関連項目:
PhysicsRigidBody.setCcdSweptSphereRadius(float)

setBoneCcdMotionThreshold

@Deprecated
public void setBoneCcdMotionThreshold(java.lang.String boneName,
                                                 float value)
推奨されていません。 use getBoneRigidBody(String BoneName).setCcdMotionThreshold(float) instead

Set the CcdMotionThreshold of the given bone's rigidBodies of the ragdoll

パラメータ:
value -
関連項目:
PhysicsRigidBody.setCcdMotionThreshold(float)

setBoneCcdSweptSphereRadius

@Deprecated
public void setBoneCcdSweptSphereRadius(java.lang.String boneName,
                                                   float value)
推奨されていません。 use getBoneRigidBody(String BoneName).setCcdSweptSphereRadius(float) instead

Set the CcdSweptSphereRadius of the given bone's rigidBodies of the ragdoll

パラメータ:
value -
関連項目:
PhysicsRigidBody.setCcdSweptSphereRadius(float)

getBoneRigidBody

public PhysicsRigidBody getBoneRigidBody(java.lang.String boneName)
return the rigidBody associated to the given bone

パラメータ:
boneName - the name of the bone
戻り値:
the associated rigidBody.