Get bone location?

Hey, I’m trying to be able to get the bone location/rotation in my game so I can attach a PhysicsRigidBodyControl to it (for weapon collision detection)…

So far, I’ve only thought to use [java]animationControl.getSkeleton().getBone(“hand.right”).getModelSpacePosition()[/java] and also [java]animationControl.getSkeleton().getBone(“hand.right”).getModelSpaceRotation();[/java]

The rotation is working right, I think, but the Postition is returning fairly low numbers as I move around the world ((-2.5498295, 0.33712113, -0.05638109) as an example (it’s one of the highest)). I’ve tried [java]animationControl.getSkeleton().getBone(“hand.right”).getLocalPosition();[/java] but it just stays the same.

So, what should I do? Is there any other way to do this? Thanks.

The bones are located in Model Space, ie relative to the origin of the Spatial they’re part of. If you add their location to the Spatials location, you should get correct values.

That makes so much sense! Thanks rickard! I should’ve been able to figure that out from the method :expressionless: I guess I was off today… Thanks though, it works now (getting the right values).