Transform t = childBone.getCombinedTransform(pos, rot); setTransform(childBone, t.getTranslation(), t.getRotation(), restoreBoneControl, boneList);
Transform t = childBone.getCombinedTransform(pos, rot); setTransform(childBone, t.getTranslation(), t.getRotation(), restoreBoneControl, boneList);
/** * Updates a bone position and rotation. * if the child bones are not in the bone list this means, they are not associated with a physic shape. * So they have to be updated * @param bone the bone * @param pos the position * @param rot the rotation */ public static void setTransform(Bone bone, Vector3f pos, Quaternion rot, boolean restoreBoneControl, Set<String> boneList) { //we ensure that we have the control if (restoreBoneControl) { bone.setUserControl(true); } //we set te user transforms of the bone bone.setUserTransformsInModelSpace(pos, rot); for (Bone childBone : bone.getChildren()) { //each child bone that is not in the list is updated if (!boneList.contains(childBone.getName())) { Transform t = childBone.getCombinedTransform(pos, rot); setTransform(childBone, t.getTranslation(), t.getRotation(), restoreBoneControl, boneList); } } //we give back the control to the keyframed animation if (restoreBoneControl) { bone.setUserControl(false); } }
/** * Updates a bone position and rotation. * if the child bones are not in the bone list this means, they are not associated with a physic shape. * So they have to be updated * @param bone the bone * @param pos the position * @param rot the rotation */ public static void setTransform(Bone bone, Vector3f pos, Quaternion rot, boolean restoreBoneControl, Set<String> boneList) { //we ensure that we have the control if (restoreBoneControl) { bone.setUserControl(true); } //we set te user transforms of the bone bone.setUserTransformsWorld(pos, rot); for (Bone childBone : bone.getChildren()) { //each child bone that is not in the list is updated if (!boneList.contains(childBone.getName())) { Transform t = childBone.getCombinedTransform(pos, rot); setTransform(childBone, t.getTranslation(), t.getRotation(), restoreBoneControl, boneList); } } //we give back the control to the keyframed animation if (restoreBoneControl) { bone.setUserControl(false); } }
Transform t = childBone.getCombinedTransform(pos, rot); setTransform(childBone, t.getTranslation(), t.getRotation(), restoreBoneControl, boneList);