Ver código fonte

Added length of the bone to the BoneContext (this will be needed later by some of the constraints).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10400 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Kae..pl 12 anos atrás
pai
commit
9f4544a3a8

+ 10 - 0
engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java

@@ -47,6 +47,8 @@ public class BoneContext {
 	private Matrix4f			inverseTotalTransformation;
 	/** Bone's parent inverse matrix. */
 	private Matrix4f			inverseParentMatrix;
+	/** The length of the bone. */
+	private float				length;
 
 	/**
 	 * Constructor. Creates the basic set of bone's data.
@@ -93,6 +95,7 @@ public class BoneContext {
 		this.boneStructure = boneStructure;
 		this.armatureObjectOMA = armatureObjectOMA;
 		boneName = boneStructure.getFieldValue("name").toString();
+		length = ((Number)boneStructure.getFieldValue("length")).floatValue();
 		ObjectHelper objectHelper = blenderContext.getHelper(ObjectHelper.class);
 		armatureMatrix = objectHelper.getMatrix(boneStructure, "arm_mat", true);
 
@@ -216,6 +219,13 @@ public class BoneContext {
 		return boneStructure.getOldMemoryAddress();	
 	}
 	
+	/**
+	 * @return the length of the bone
+	 */
+	public float getLength() {
+		return length;
+	}
+	
 	/**
 	 * @return OMA of the bone's armature object
 	 */