Ray casting animated models

I have a Zombie game. The zombies have a run animation and I need to shoot rays at the zombies to hurt them.



The problem I am having is when shooting a ray it will only get collisions between the ray and the unanimated shape of the model.

This is making the hit detection quite unreliable.



For example I can’t reliably shoot the arms of the zombie because the run animation has the arms in a different place to the unanimated base mesh.



Is there a way to have the ray intersect with the model so that it will hit the animated parts of the zombie reliably?

Help much appreciated.

I have the same problem at the moment.

There are differences when the bind pose is way different, than the currently animated pose. In my case the models stomach is at 0/0/0 but when animated the whole model is 0.8 units up in z direction. Displaying a non animated model shows the bounding box enclosing the mesh. But when animated the bounding box stays where it was when not animated (half below my model)

@normen I remember reading this was a todo mentioned by you, so the bounding box would be the max of all animation frames. Do you have any design ideas on this? Because at the moment this is an awkward thing. The mesh has the bounds and update bounds stuff, but no reference to geometry to pass an updated bounds upwards. The skeleton/skeletoncontrol has a reference to the mesh and the animation data, but no means to update the spatial the mesh belongs to. I have succeeded in updating the bbox of the mesh for display, but as the updated bounds is not propagated upwards in the node hierarchy I have no means to get this right for picking which checks with the bounding box before going into details.

A work around would be to use the ragdoll control and set it to kinematic…

It will place collision shapes on the mesh for each bones that will move with it while animated.

Then you can check collision against the collision shapes.

Im having trouble with that solution.

The KinematicRagdollControl collides with the ridigBodyControl im using to make the zombies walk around and collide with each other.

(Using RigidBobyControl with angular factor of 0 with a capsule collision shape)



Is there a way round this since i can’t see a way to remove the colliding since KinematicRagdollControl has no setCollisionGroup methods.