www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: idkm23 on March 17, 2016, 08:41:39 pm

Title: Adding an Object3D to a bone
Post by: idkm23 on March 17, 2016, 08:41:39 pm
My question is simple: How would I add an object3D to a bone? I am making bounding boxes around the limbs of ONE model&skeleton to create collisions between the limbs of the model (so for example the arm cant phase into the torso). I made a box that surrounds the arm (in the base pose), but now I want the box to follow the arm wherever it is. I basically want the vertices to be attached to the bone just like the mesh. Any ideas are appreciated, thanks.
Title: Re: Adding an Object3D to a bone
Post by: AGP on March 18, 2016, 11:42:01 am
What about storing the individual joints with getJointByName(), then using the following method?

Code: [Select]
     public SimpleVector getJointPosition(Joint joint) {
SimpleVector location = skeletonPose.getGlobal(joint.getIndex()).getTranslation();
location.matMul(model.get(0).getWorldTransformation());
return location;
     }