Home | History | Annotate | Download | only in control

Lines Matching refs:Bone

35 import com.jme3.animation.Bone;
73 * <li>The shape is HullCollision shape based on the vertices associated with each bone and based on a tweakable weight threshold (see setWeightThreshold)</li>
74 * <li>If you don't want each bone to be a collision shape, you can specify what bone to use by using the addBoneName method<br>
75 * By using this method, bone that are not used to create a shape, are "merged" to their parent to create the collision shape.
130 protected Bone bone;
166 //if the ragdoll has the control of the skeleton, we update each bone with its position in physic world space.
172 //retrieving bone position in physic world space
177 //retrieving bone rotation in physic world space
180 //multiplying this rotation by the initialWorld rotation of the bone,
186 //if the bone is the root bone, we apply the physic's transform to the model, so its position and rotation are correctly updated
187 if (link.bone.getParent() == null) {
189 //offsetting the physic's position/rotation by the root bone inverse model space position/rotaion
190 modelPosition.set(p).subtractLocal(link.bone.getWorldBindPosition());
192 modelRotation.set(q).multLocal(tmpRot2.set(link.bone.getWorldBindRotation()).inverseLocal());
200 //Applying computed transforms to the bone
201 link.bone.setUserTransformsWorld(position, tmpRot1);
204 //if boneList is empty, this means that every bone in the ragdoll has a collision shape,
205 //so we just update the bone position
207 link.bone.setUserTransformsWorld(position, tmpRot1);
211 RagdollUtils.setTransform(link.bone, position, tmpRot1, false, boneList);
230 tmpRot2.set(tmpRot1).nlerp(link.bone.getModelSpaceRotation(), blendStart / blendTime);
231 position2.set(position).interpolate(link.bone.getModelSpacePosition(), blendStart / blendTime);
237 //we ensure we have the control to update the bone
238 link.bone.setUserControl(true);
239 link.bone.setUserTransformsWorld(position, tmpRot1);
241 link.bone.setUserControl(false);
243 RagdollUtils.setTransform(link.bone, position, tmpRot1, true, boneList);
266 * Set the transforms of a rigidBody to match the transforms of a bone.
268 * @param link the link containing the bone and the rigidBody
274 targetModel.getWorldTransform().transformVector(link.bone.getModelSpacePosition(), position);
277 tmpRot1.set(link.bone.getModelSpaceRotation()).multLocal(link.bone.getWorldBindInverseRotation());
281 //updating physic location/rotation of the physic bone
328 // put into bind pose and compute bone transforms in model space
345 * Add a bone name to this control
363 Bone childBone = skeleton.getRoots()[i];
365 logger.log(Level.INFO, "Found root bone in skeleton {0}", skeleton);
373 private void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int reccount, Map<Integer, List<Float>> pointsMap) {
375 if (boneList.isEmpty() || boneList.contains(bone.getName())) {
378 link.bone = bone;
383 //build a shape for the bone, using the vertices that are most influenced by this bone
384 shape = RagdollUtils.makeShapeFromPointMap(pointsMap, RagdollUtils.getBoneIndices(link.bone, skeleton, boneList), initScale, link.bone.getModelSpacePosition());
386 //build a shape for the bone, using the vertices associated with this bone with a weight above the threshold
387 shape = RagdollUtils.makeShapeFromVerticeWeights(model, RagdollUtils.getBoneIndices(link.bone, skeleton, boneList), initScale, link.bone.getModelSpacePosition(), weightThreshold);
396 link.initalWorldRotation = bone.getModelSpaceRotation().clone();
401 if (bone.getParent() != null) {
402 bone.getModelSpacePosition().subtract(bone.getParent().getModelSpacePosition(), posToParent).multLocal(initScale);
406 preset.setupJointForBone(bone.getName(), joint);
411 boneLinks.put(bone.getName(), link);
416 for (Iterator<Bone> it = bone.getChildren().iterator(); it.hasNext();) {
417 Bone childBone = it.next();
423 * Set the joint limits for the joint between the given bone and its parent.
425 * @param boneName the name of the bone
438 logger.log(Level.WARNING, "Not joint was found for bone {0}. make sure you call spatial.addControl(ragdoll) before setting joints limit", boneName);
443 * Return the joint between the given bone and its parent.
445 * @param boneName the name of the bone
446 * @return the joint between the given bone and its parent
453 logger.log(Level.WARNING, "Not joint was found for bone {0}. make sure you call spatial.addControl(ragdoll) before setting joints limit", boneName);
633 Bone hitBone = null;
636 //Computing which bone has been hit
641 hitBone = link.bone;
650 hitBone = link.bone;
692 for (Bone bone : skeleton.getRoots()) {
693 RagdollUtils.setUserControl(bone, mode == Mode.Ragdoll);
734 for (Bone bone : skeleton.getRoots()) {
735 RagdollUtils.setUserControl(bone, false);
806 * Set the CcdMotionThreshold of all the bone's rigidBodies of the ragdoll
817 * Set the CcdSweptSphereRadius of all the bone's rigidBodies of the ragdoll
828 * Set the CcdMotionThreshold of the given bone's rigidBodies of the ragdoll
842 * Set the CcdSweptSphereRadius of the given bone's rigidBodies of the ragdoll
856 * return the rigidBody associated to the given bone
857 * @param boneName the name of the bone