Because there seems to be no possible way to get rayTest nor common ray to react to an animated mesh
I found a solution.
If I enable debug, then I can get the debug shape for all the bones, and then I can use a normal ray
and see if it collides with the debug meshes.
The problem is that I do not want to see the wireframe all the time.
I only need to see them when Im debugging, not playing.
And if I disable them by NOT calling bulletAppState.getPhysicsSpace().enableDebug(assetManager);
then ragdoll.getBoneRigidBody(“Bone”).debugShape(); will return null.
I need it to return a debug shape without the renderer rendering it. Is that possible?
No, you need a way to ray test the bullet geometry, that is your basic problem.
I don’t know how far support for that is with normens bullt/jbullet wrapper, but at least I know that both support rays themself. So either it is already implemented and you just have to find it, or you might want to try implement it yourself.
The solution you are currently useing is only a dirty hack.
Yea, but he says its working, tho its not…
I detect ray intersections with animated meshes all the time and it works fine for me. I checked your other thread - I don’t know what’s wrong with your code exactly but you don’t have to attach shapes to each limb. Just check for collisions with the animated mesh. My code looks like this:
[java]CollisionResults results = new CollisionResults();
Ray ray = new Ray(user.getStage().getCamera().getLocation(), user.getStage().getCamera().getDirection());
user.getStage().getActors().get(Integer.parseInt(results.getClosestCollision().getGeometry().getName())).hurt(damage * tpf);
System.out.println("You can’t shoot this. " + e.getMessage());
What is user.getStage() returning? The SimpleApplication file?
user.getStage().getRootNode() with my rootnode
set shooting to true
put user.getStage().getActors().get(Integer.parseInt(results.getClosestCollision().getGeometry().getName())).hurt(damage * tpf); in comment.
But still this returns null.
This error is really making me tired.
what if your code is 100% correct, but 1 minor detail prevents it from working, like the 3d model not being named, or having some weird attribute on import. I am only tossing ideas, since you have tried everything. I still haven’t done the Beginner physics tutorial so i don’t know about these things.