Game Development Reference
In-Depth Information
5. To make it reusable, we use the
setEnabled
method to clear things up when
the control is not in use; we make it apply IK when it's enabled again:
if(enabled){
sampleTargetPositions();
} else {
spatial.getControl(KinematicRagdollControl.class).removeAllIKTargets();
spatial.getControl(KinematicRagdollControl.class).setKinematicMode();
}