@Deprecated public class KinematicRagdollControl extends AbstractPhysicsControl implements PhysicsCollisionListener, JmeCloneable
This control creates collision shapes for each bones of the skeleton when you invoke spatial.addControl(ragdollControl).
There are 2 modes for this control :
This class is shared between JBullet and Native Bullet.
Modifier and Type | Class and Description |
---|---|
static class |
KinematicRagdollControl.Mode
Deprecated.
Enumerate joint-control modes for this control.
|
class |
KinematicRagdollControl.PhysicsBoneLink
Deprecated.
Link a bone to a jointed rigid body.
|
Modifier and Type | Field and Description |
---|---|
protected PhysicsRigidBody |
baseRigidBody
Deprecated.
|
protected boolean |
blendedControl
Deprecated.
|
protected float |
blendStart
Deprecated.
|
protected float |
blendTime
Deprecated.
blending interval for animations (in seconds, ≥0)
|
protected java.util.Map<java.lang.String,KinematicRagdollControl.PhysicsBoneLink> |
boneLinks
Deprecated.
|
protected java.util.Set<java.lang.String> |
boneList
Deprecated.
|
protected boolean |
debug
Deprecated.
|
protected float |
eventDispatchImpulseThreshold
Deprecated.
|
protected Vector3f |
initScale
Deprecated.
|
protected java.util.List<RagdollCollisionListener> |
listeners
Deprecated.
|
protected static java.util.logging.Logger |
logger
Deprecated.
list of registered collision listeners
|
protected KinematicRagdollControl.Mode |
mode
Deprecated.
|
protected Vector3f |
modelPosition
Deprecated.
|
protected Quaternion |
modelRotation
Deprecated.
|
protected RagdollPreset |
preset
Deprecated.
|
protected float |
rootMass
Deprecated.
|
protected Skeleton |
skeleton
Deprecated.
skeleton being controlled
|
protected Spatial |
targetModel
Deprecated.
model being controlled
|
protected float |
totalMass
Deprecated.
accumulate total mass of ragdoll when control is added to a scene
|
protected float |
weightThreshold
Deprecated.
|
added, applyLocal, enabled, space, spatial
Constructor and Description |
---|
KinematicRagdollControl()
Deprecated.
Instantiate an enabled control.
|
KinematicRagdollControl(float weightThreshold)
Deprecated.
Instantiate an enabled control with the specified weight threshold.
|
KinematicRagdollControl(RagdollPreset preset)
Deprecated.
Instantiate an enabled control with the specified preset.
|
KinematicRagdollControl(RagdollPreset preset,
float weightThreshold)
Deprecated.
Instantiate an enabled control with the specified preset and weight
threshold.
|
Modifier and Type | Method and Description |
---|---|
void |
addBoneName(java.lang.String name)
Deprecated.
Add a bone name to this control.
|
void |
addCollisionListener(RagdollCollisionListener listener)
Deprecated.
Add a collision listener to this control.
|
protected void |
addPhysics(PhysicsSpace space)
Deprecated.
Add all managed physics objects to the specified space.
|
void |
applyUserControl()
Deprecated.
Ensure that user control is enabled for any bones used by inverse
kinematics and disabled for any other bones.
|
void |
blendToKinematicMode(float blendTime)
Deprecated.
Smoothly blend from Ragdoll mode to Kinematic mode This is useful to
blend ragdoll actual position to a keyframe animation for example
|
protected void |
boneRecursion(Spatial model,
Bone bone,
PhysicsRigidBody parent,
int reccount,
java.util.Map<java.lang.Integer,java.util.List<java.lang.Float>> pointsMap)
Deprecated.
Generate a physics shape and bone links for the specified bone.
|
void |
collision(PhysicsCollisionEvent event)
Deprecated.
For internal use only: callback for collision event
|
protected void |
createSpatialData(Spatial model)
Deprecated.
Create spatial-dependent data.
|
Bone |
getBone(java.lang.String name)
Deprecated.
Access the named bone.
|
PhysicsRigidBody |
getBoneRigidBody(java.lang.String boneName)
Deprecated.
Access the rigidBody associated with the named bone.
|
float |
getEventDispatchImpulseThreshold()
Deprecated.
Read the ragdoll's event-dispatch impulse threshold.
|
float |
getIkRotSpeed()
Deprecated.
Read the rotation speed for inverse kinematics.
|
float |
getIKThreshold()
Deprecated.
Read the distance threshold for inverse kinematics.
|
SixDofJoint |
getJoint(java.lang.String boneName)
Deprecated.
Return the joint between the specified bone and its parent.
|
float |
getLimbDampening()
Deprecated.
Read the limb damping.
|
KinematicRagdollControl.Mode |
getMode()
Deprecated.
returns the mode of this control
|
float |
getTotalMass()
Deprecated.
Read the ragdoll's total mass.
|
float |
getWeightThreshold()
Deprecated.
Read the ragdoll's weight threshold.
|
java.lang.Object |
jmeClone()
Deprecated.
Create a shallow clone for the JME cloner.
|
protected void |
kinematicUpdate(float tpf)
Deprecated.
Update this control in Kinematic mode, based on bone animation tracks.
|
protected void |
matchPhysicObjectToBone(KinematicRagdollControl.PhysicsBoneLink link,
Vector3f position,
Quaternion tmpRot1)
Deprecated.
Alter the transforms of a rigidBody to match the transforms of a bone.
|
protected void |
ragDollUpdate(float tpf)
Deprecated.
Update this control in Ragdoll mode, based on Bullet physics.
|
void |
read(JmeImporter im)
Deprecated.
De-serialize this control, for example when loading from a J3O file.
|
void |
reBuild()
Deprecated.
Rebuild the ragdoll.
|
void |
removeAllIKTargets()
Deprecated.
Remove all inverse-kinematics targets.
|
void |
removeIKTarget(Bone bone)
Deprecated.
Remove the inverse-kinematics target for the specified bone.
|
protected void |
removePhysics(PhysicsSpace space)
Deprecated.
Remove all managed physics objects from the specified space.
|
protected void |
removeSpatialData(Spatial spat)
Deprecated.
Destroy spatial-dependent data.
|
void |
render(RenderManager rm,
ViewPort vp)
Deprecated.
Render this control.
|
protected void |
scanSpatial(Spatial model)
Deprecated.
Generate physics shapes and bone links for the skeleton.
|
void |
setCcdMotionThreshold(float value)
Deprecated.
Alter the CcdMotionThreshold of all rigid bodies in the ragdoll.
|
void |
setCcdSweptSphereRadius(float value)
Deprecated.
Alter the CcdSweptSphereRadius of all rigid bodies in the ragdoll.
|
void |
setEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold)
Deprecated.
Alter the ragdoll's event-dispatch impulse threshold.
|
void |
setIKMode()
Deprecated.
Sets the control into Inverse Kinematics mode.
|
void |
setIkRotSpeed(float ikRotSpeed)
Deprecated.
Alter the rotation speed for inverse kinematics.
|
Vector3f |
setIKTarget(Bone bone,
Vector3f worldPos,
int chainLength)
Deprecated.
Add a target for inverse kinematics.
|
void |
setIKThreshold(float IKThreshold)
Deprecated.
Alter the distance threshold for inverse kinematics.
|
void |
setJointLimit(java.lang.String boneName,
float maxX,
float minX,
float maxY,
float minY,
float maxZ,
float minZ)
Deprecated.
Alter the limits of the joint connecting the specified bone to its
parent.
|
void |
setKinematicMode()
Deprecated.
Put the control into Kinematic mode.
|
void |
setLimbDampening(float limbDampening)
Deprecated.
Alter the limb damping.
|
protected void |
setMode(KinematicRagdollControl.Mode mode)
Deprecated.
Enable or disable the ragdoll behaviour.
|
protected void |
setPhysicsLocation(Vector3f vec)
Deprecated.
Translate the physics object to the specified location.
|
protected void |
setPhysicsRotation(Quaternion quat)
Deprecated.
Rotate the physics object to the specified orientation.
|
void |
setRagdollMode()
Deprecated.
Sets the control into Ragdoll mode The skeleton is entirely controlled by
physics.
|
void |
setRootMass(float rootMass)
Deprecated.
Alter the ragdoll's root mass.
|
void |
setWeightThreshold(float weightThreshold)
Deprecated.
Alter the ragdoll's weight threshold.
|
void |
update(float tpf)
Deprecated.
Update this control.
|
void |
updateBone(KinematicRagdollControl.PhysicsBoneLink link,
float tpf,
TempVars vars,
Quaternion tmpRot1,
Quaternion[] tmpRot2,
Bone tipBone,
Vector3f target,
int depth,
int maxDepth)
Deprecated.
Update a bone and its ancestors in IK mode.
|
void |
write(JmeExporter ex)
Deprecated.
Serialize this control, for example when saving to a J3O file.
|
applyPhysicsTransform, cloneFields, cloneForSpatial, getPhysicsSpace, getSpatial, getSpatialRotation, getSpatialTranslation, isApplyPhysicsLocal, isEnabled, setApplyPhysicsLocal, setEnabled, setPhysicsSpace, setSpatial
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cloneFields
protected static final java.util.logging.Logger logger
protected java.util.List<RagdollCollisionListener> listeners
protected final java.util.Set<java.lang.String> boneList
protected final java.util.Map<java.lang.String,KinematicRagdollControl.PhysicsBoneLink> boneLinks
protected final Vector3f modelPosition
protected final Quaternion modelRotation
protected final PhysicsRigidBody baseRigidBody
protected Spatial targetModel
protected Skeleton skeleton
protected RagdollPreset preset
protected Vector3f initScale
protected KinematicRagdollControl.Mode mode
protected boolean debug
protected boolean blendedControl
protected float weightThreshold
protected float blendStart
protected float blendTime
protected float eventDispatchImpulseThreshold
protected float rootMass
protected float totalMass
public KinematicRagdollControl()
public KinematicRagdollControl(float weightThreshold)
weightThreshold
- (>0, <1)public KinematicRagdollControl(RagdollPreset preset, float weightThreshold)
preset
- (not null)weightThreshold
- (>0, <1)public KinematicRagdollControl(RagdollPreset preset)
preset
- (not null)public void update(float tpf)
update
in interface Control
update
in class AbstractPhysicsControl
tpf
- the time interval between frames (in seconds, ≥0)protected void ragDollUpdate(float tpf)
tpf
- the time interval between frames (in seconds, ≥0)protected void kinematicUpdate(float tpf)
tpf
- the time interval between frames (in seconds, ≥0)public void updateBone(KinematicRagdollControl.PhysicsBoneLink link, float tpf, TempVars vars, Quaternion tmpRot1, Quaternion[] tmpRot2, Bone tipBone, Vector3f target, int depth, int maxDepth)
link
- the bone link for the affected bone (may be null)tpf
- the time interval between frames (in seconds, ≥0)vars
- unusedtmpRot1
- temporary storage used in calculations (not null)tmpRot2
- temporary storage used in calculations (not null)tipBone
- (not null)target
- the location target in model space (not null, unaffected)depth
- depth of the recursion (≥0)maxDepth
- recursion limit (≥0)protected void matchPhysicObjectToBone(KinematicRagdollControl.PhysicsBoneLink link, Vector3f position, Quaternion tmpRot1)
link
- the bone link connecting the bone and the rigidBodyposition
- temporary storage used in calculations (not null)tmpRot1
- temporary storage used in calculations (not null)public void reBuild()
protected void createSpatialData(Spatial model)
createSpatialData
in class AbstractPhysicsControl
model
- the controlled spatial (not null)protected void removeSpatialData(Spatial spat)
removeSpatialData
in class AbstractPhysicsControl
spat
- the previously controlled spatial (not null)public void addBoneName(java.lang.String name)
Not allowed after attaching the control.
name
- the name of the bone to addprotected void scanSpatial(Spatial model)
model
- the spatial with the model's SkeletonControl (not null)protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int reccount, java.util.Map<java.lang.Integer,java.util.List<java.lang.Float>> pointsMap)
model
- the spatial with the model's SkeletonControl (not null)bone
- the bone to be linked (not null)parent
- the body linked to the parent bone (not null)reccount
- depth of the recursion (≥1)pointsMap
- (not null)public void setJointLimit(java.lang.String boneName, float maxX, float minX, float maxY, float minY, float maxZ, float minZ)
boneName
- the name of the bonemaxX
- 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 Y axis (in radians)maxZ
- the maximum rotation on the Z axis (in radians)minZ
- the minimum rotation on the Z axis (in radians)public SixDofJoint getJoint(java.lang.String boneName)
boneName
- the name of the boneprotected void setPhysicsLocation(Vector3f vec)
AbstractPhysicsControl
setPhysicsLocation
in class AbstractPhysicsControl
vec
- desired location (not null, unaffected)protected void setPhysicsRotation(Quaternion quat)
AbstractPhysicsControl
setPhysicsRotation
in class AbstractPhysicsControl
quat
- desired orientation (not null, unaffected)protected void addPhysics(PhysicsSpace space)
AbstractPhysicsControl
addPhysics
in class AbstractPhysicsControl
space
- which physics space to add to (not null)protected void removePhysics(PhysicsSpace space)
AbstractPhysicsControl
removePhysics
in class AbstractPhysicsControl
space
- which physics space to remove from (not null)public void collision(PhysicsCollisionEvent event)
collision
in interface PhysicsCollisionListener
event
- (not null)protected void setMode(KinematicRagdollControl.Mode mode)
mode
- an enum value (not null)public void blendToKinematicMode(float blendTime)
blendTime
- the blending time between ragdoll to anim.public void setKinematicMode()
public void setRagdollMode()
public void setIKMode()
public KinematicRagdollControl.Mode getMode()
public void addCollisionListener(RagdollCollisionListener listener)
listener
- (not null, alias created)public void setRootMass(float rootMass)
rootMass
- the desired mass (≥0)public float getTotalMass()
public float getWeightThreshold()
public void setWeightThreshold(float weightThreshold)
weightThreshold
- the desired thresholdpublic float getEventDispatchImpulseThreshold()
public void setEventDispatchImpulseThreshold(float eventDispatchImpulseThreshold)
eventDispatchImpulseThreshold
- desired thresholdpublic void setCcdMotionThreshold(float value)
value
- the desired threshold value (velocity, >0) or zero to
disable CCD (default=0)PhysicsRigidBody.setCcdMotionThreshold(float)
public void setCcdSweptSphereRadius(float value)
value
- the desired radius of the sphere used for continuous
collision detection (≥0)PhysicsRigidBody.setCcdSweptSphereRadius(float)
public PhysicsRigidBody getBoneRigidBody(java.lang.String boneName)
boneName
- the name of the bonepublic void render(RenderManager rm, ViewPort vp)
render
in interface Control
render
in class AbstractPhysicsControl
rm
- the render manager (not null)vp
- the view port to render (not null)public java.lang.Object jmeClone()
jmeClone
in interface JmeCloneable
public Vector3f setIKTarget(Bone bone, Vector3f worldPos, int chainLength)
bone
- which bone the IK applies to (not null)worldPos
- the world coordinates of the goal (not null)chainLength
- number of bones in the chainpublic void removeIKTarget(Bone bone)
bone
- which bone has the target (not null, modified)public void removeAllIKTargets()
public void applyUserControl()
public float getIkRotSpeed()
public void setIkRotSpeed(float ikRotSpeed)
ikRotSpeed
- the desired speed (≥0, default=7)public float getIKThreshold()
public void setIKThreshold(float IKThreshold)
IKThreshold
- the desired distance threshold (default=0.1)public float getLimbDampening()
public void setLimbDampening(float limbDampening)
limbDampening
- the desired viscous damping ratio (0→no
damping, 1→critically damped, default=0.6)public Bone getBone(java.lang.String name)
name
- which bone to accesspublic void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class AbstractPhysicsControl
ex
- exporter (not null)java.io.IOException
- from exporterpublic void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class AbstractPhysicsControl
im
- importer (not null)java.io.IOException
- from importer