Hello monkeys!
I can’t seem to get a handle on mousepicking ragdolls.
I am using KinematicRagdollControl.
My goal is to be able to show a healthbar when (and only when) the ragdoll character is mouse picked.
Ray ray = new Ray(origin, direction);
CollisionResults results = new CollisionResults();
shootables.collideWith(ray, results);
if (results.size() > 0) {
CollisionResult closest = results.getClosestCollision();
mark.setLocalTranslation(closest.getContactPoint());
Quaternion q = new Quaternion();
q.lookAt(closest.getContactNormal(), Vector3f.UNIT_Y);
mark.setLocalRotation(q);
rootNode.attachChild(mark);
}
I have a list of players, each with it’s own ragdoll.
The spatial that my ragdoll is attached to contains userdata with health and stuff.
Now, the collision results do not give me a geom or spatial so how can I retrieve the userdata that I put in using these results?