From 9f4544a3a86b406e40ac045f91c2d7954ce92ba0 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Thu, 14 Feb 2013 09:15:55 +0000 Subject: [PATCH] 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 --- .../scene/plugins/blender/animations/BoneContext.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java b/engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java index 956b93c00..9635abfdd 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java +++ b/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 */