Updating btGImpactMeshShape mesh

Post Reply
vipinjs
Posts: 13
Joined: Wed Nov 26, 2014 9:48 am

Updating btGImpactMeshShape mesh

Post by vipinjs »

Hello everyone,

I am working on a problem where a virtual human is walking around and I need to check whether he collides with the environment or not.
The motion data for the avatar is provided by a BVH file (motion captured data) and I could successfully recreate the human motion using the avatar geometry (I visualized it in OpenGL and the motion is as expected).
I used btGImpactMeshShape to represent the avatar and the environment geometries. So basically I am trying to check collisions between two btGImpactMeshShapes.
The issue is, as and when the avatar mesh changes (mesh vertices) I am calling postUpdate and UpdateBound. This should ideally change the mesh structure of the avatar (coz his posture is changing in every frame of the motion data).
when the collisions are checked for each frame, for initial few frames collisions are getting detected and after that no collisions are getting detected. I fixed this issue by creating new instances of collision shape of avatar in every motion frame. Now the collisions are getting identified, but the computation time is more than the acceptable level.

I am using contactPairTest to compute the collisions and the collision algorithm has been registered as btGImpactCollisionAlgorithm. There are 1600 frames in the motion data and collision detection works around for first 500 frames. Afterwards no collisions are getting detected, even though the avatar penetrates some of the objects in the environment.

Also, when I checked AvatarCollisionShape->hasBoxSet(), it returned false.

Any suggestions to improve the performance?

Thanks in advance
Vipin
Post Reply