public Bone getJmeBone() { if (bone == null) { bone = new Bone(name); bone.setBindTransforms(jmeLocalBindPose.getTranslation(), jmeLocalBindPose.getRotation(), jmeLocalBindPose.getScale()); } return bone; } }
/** * Special-purpose copy constructor. * <p> * Shallow copies bind pose data from the source skeleton, does not * copy any other data. * * @param source The source Skeleton to copy from */ public Skeleton(Skeleton source) { Bone[] sourceList = source.boneList; boneList = new Bone[sourceList.length]; for (int i = 0; i < sourceList.length; i++) { boneList[i] = new Bone(sourceList[i]); } rootBones = new Bone[source.rootBones.length]; for (int i = 0; i < rootBones.length; i++) { rootBones[i] = recreateBoneStructure(source.rootBones[i]); } createSkinningMatrices(); for (int i = rootBones.length - 1; i >= 0; i--) { rootBones[i].update(); } }
this.buildBones(armatureObject.getOldMemoryAddress(), bonebase.get(i), null, bonesList, objectStructure.getOldMemoryAddress(), blenderContext); bonesList.add(0, new Bone("")); Bone[] bones = bonesList.toArray(new Bone[bonesList.size()]); skeleton = new Skeleton(bones);
bone = new Bone("root"); bone.setBindTransforms(Vector3f.ZERO, Quaternion.IDENTITY, Vector3f.UNIT_XYZ); bone.setUserControl(true);
this.skeletonOwnerOma = skeletonOwnerOma; Long boneOMA = boneStructure.getOldMemoryAddress(); bone = new Bone(boneName); bones.add(bone); blenderContext.addLoadedFeatures(boneOMA, LoadedDataType.STRUCTURE, boneStructure);
public Bone readNodeAsBone(int nodeIndex, int boneIndex, int skinIndex, Matrix4f modelBindMatrix) throws IOException { BoneWrapper boneWrapper = fetchFromCache("nodes", nodeIndex, BoneWrapper.class); if (boneWrapper != null) { return boneWrapper.bone; } JsonObject nodeData = nodes.get(nodeIndex).getAsJsonObject(); String name = getAsString(nodeData, "name"); if (name == null) { name = "Bone_" + nodeIndex; } Bone bone = new Bone(name); Transform boneTransforms = null; boneTransforms = readTransforms(nodeData); addToCache("nodes", nodeIndex, new BoneWrapper(bone, boneIndex, skinIndex, modelBindMatrix, boneTransforms), nodes.size()); return bone; }
bone = new Bone(attribs.getValue("name")); int id = SAXUtil.parseInt(attribs.getValue("id")); indexToBone.put(id, bone);
bone = new Bone(attribs.getValue("name")); int id = SAXUtil.parseInt(attribs.getValue("id")); indexToBone.put(id, bone);
bone = new Bone(attribs.getValue("name")); int id = SAXUtil.parseInt(attribs.getValue("id")); indexToBone.put(id, bone);
public Bone getJmeBone() { if (bone == null) { bone = new Bone(name); bone.setBindTransforms(jmeLocalBindPose.getTranslation(), jmeLocalBindPose.getRotation(), jmeLocalBindPose.getScale()); } return bone; } }
/** * Special-purpose copy constructor. * <p> * Shallow copies bind pose data from the source skeleton, does not * copy any other data. * * @param source The source Skeleton to copy from */ public Skeleton(Skeleton source) { Bone[] sourceList = source.boneList; boneList = new Bone[sourceList.length]; for (int i = 0; i < sourceList.length; i++) { boneList[i] = new Bone(sourceList[i]); } rootBones = new Bone[source.rootBones.length]; for (int i = 0; i < rootBones.length; i++) { rootBones[i] = recreateBoneStructure(source.rootBones[i]); } createSkinningMatrices(); for (int i = rootBones.length - 1; i >= 0; i--) { rootBones[i].update(); } }
/** * Special-purpose copy constructor. * <p> * Shallow copies bind pose data from the source skeleton, does not * copy any other data. * * @param source The source Skeleton to copy from */ public Skeleton(Skeleton source) { Bone[] sourceList = source.boneList; boneList = new Bone[sourceList.length]; for (int i = 0; i < sourceList.length; i++) { boneList[i] = new Bone(sourceList[i]); } rootBones = new Bone[source.rootBones.length]; for (int i = 0; i < rootBones.length; i++) { rootBones[i] = recreateBoneStructure(source.rootBones[i]); } createSkinningMatrices(); for (int i = rootBones.length - 1; i >= 0; i--) { rootBones[i].update(); } }
for(long limbId : limbMap.keySet()) { Limb limb = limbMap.get(limbId); Bone bone = new Bone(limb.name); Transform t = limb.bindTransform; bone.setBindTransforms(t.getTranslation(), t.getRotation(), t.getScale());
int boneIndex = 0; for (PMDBone pmdBone : model.getBoneList().getBones()) { Bone bone = new Bone(pmdBone.getBoneName()); bone.setUserControl(true); Vector3f translation = new Vector3f(pmdBone.getBoneHeadPos().x, pmdBone.getBoneHeadPos().y, pmdBone.getBoneHeadPos().z);
jmeBones[i] = new Bone(sid); Quaternion bindRot = matrices[i].toRotationQuat(); Vector3f bindTrans = matrices[i].toTranslationVector();
node.attachChild(geom); Bone bone = new Bone("bone 0"); bone.setBindTransforms(new Vector3f(0, 0, 0), new Quaternion(Quaternion.IDENTITY), new Vector3f(Vector3f.UNIT_XYZ));
Bone bone = new Bone(node.getAttribute(Names.SID, TEXT).get()); node.setParsedData(bone); Bone parent = node.getParent().getParsedData(Bone.class);