Page 1 of 1

CollisionShapes on animated mesh (skeletal)

Posted: Tue Jul 01, 2014 7:38 am
by rawtass
I'm looking for advise on collision detection on animated meshes, actually GPU based skeletal animation (GPU skinning).

Some details:
- My animated model has a mesh (which can be split into sub-meshes), a set of bones/weights and a set of keyframes where the bones are moved.
- In a GPU based approach I do not have access of the animated vertices on the CPU side so I only have my vertices in the initial bind pose.

Here is an example of the standard Bob model with a convex hull collision shape added when the model is in it's bind pose. This particular model may be difficult becuase it has the body as one large mesh.
Image

I'm thinking I could split by mesh into smaller parts corresponding to bones and then calculate bounding boxes which could be animated by the bone/skinning matrix. Is this what is usually done?

What directions could I choose? What options do I have?

Re: CollisionShapes on animated mesh (skeletal)

Posted: Tue Jul 01, 2014 1:39 pm
by c6burns
You do have access to the transformed bones on the CPU side. So one option is to use kinematic primitives kept in alignment to the bones in order to make a close approximation to the actual character.

Re: CollisionShapes on animated mesh (skeletal)

Posted: Tue Jul 01, 2014 1:52 pm
by rawtass
c6burns wrote:You do have access to the transformed bones on the CPU side. So one option is to use kinematic primitives kept in alignment to the bones in order to make a close approximation to the actual character.
Yes, I have the skinning matrices for each bone.
That requires some careful modelling though so you have a mesh per bone? Or at least one collision mesh for each bone.

In my Bob picture for example the body is one big mesh, but it has many bones.

Re: CollisionShapes on animated mesh (skeletal)

Posted: Tue Jul 01, 2014 2:01 pm
by c6burns
Basically, yes. One shape+body per bone. Some bones won't be necessary, like fingers and toes and so on. This is how I've done it. This is how I had seen it done in CryEngine3 before working on my own platform (they do a custom export of bone meshes from 3ds max biped for hit detection, etc).