skeleton or vertex animation using bullet

pxq
Posts: 4
Joined: Fri Apr 24, 2009 3:37 pm

skeleton or vertex animation using bullet

Post by pxq »

hi, all:
like the subject said, some times, there are animations used in game.
the only method i can think of is:
1) calculate the new vertex position.
2) create a new rigid body with the new vertex position data
3) add the rigid body to world
4) physics world step
obviously, it's slow in real-time.
my question is: how can i simulate the animation using bullet efficient ?

or point me to the right direction ?

thanks in advance
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: skeleton or vertex animation using bullet

Post by Flix »

1) calculate the new vertex position.
2) create a new rigid body with the new vertex position data
3) add the rigid body to world
4) physics world step
Well, this shouldn't be done in real-time simulations.
I've never needed to do animations myself, but I suggest just using a capsule controller around the animated character (i.e. no real collisions with the mesh). You may need to recenter the controller each step, if the animation is not in-place (you can move the root node animation to a "global" rigid body transform animation if needed).

If you really need to go for the hard route maybe GImpact meshes are updatable at runtime (you should check).
A (possible?) difficult alternative is a rigid body (or character controller) per bone in skeletal animations.

About vertex animation, I don't know if the same logic that updates a concave mesh used by soft bodies can be reused in a rigid body that supports deformations by the user (maybe GImpact meshes provide this functionality...).

Regards
pxq
Posts: 4
Joined: Fri Apr 24, 2009 3:37 pm

Re: skeleton or vertex animation using bullet

Post by pxq »

hi, flix, thanks for reply.
i think capsule controller is a good idea, i'll try it.

THANK YOU VERY MUCH!