How to Get Worldspace position of a Joint

Started by AGP, June 07, 2013, 09:30:56 PM

Previous topic - Next topic

AGP

#15
No, jPCT holds a reference to the matrix. So that means that getGlobal(...) won't work for moving objects. But as this way is both very useful and very efficient, is there any chance I can persuade you to write a getGlobalWS(...)?

raft

why not just use that code? I've tested it and it works as expected.

SimpleVector location = skeletonPose.getGlobal(jointIndex).getTranslation();
location.matMul(animated3D.getWorldTransformation());


I wont and cant write such a method because a SkeletonPose knows nothing about the Animated3D and AnimatedGroup it's attached to. Furthermore, same SkeletonPose can be attached to multiple AnimatedGroup/Animated3D's.


Gatobot

hey raft thanks a lot this works great!! ;D

AGP

It's just that raft's way you have to adjust the objects every iteration, and you end up with multiple matrices that effectively do the same thing. If getGlobalWS(...) were possible, it would be faster, neater, and used less RAM.