hello,
i was wondering if anyone has experience of dynamically updating GImpact Mesh shape vertices for doing collision detection of deforming bodies.
i was wondering what is the exact procedure for modifying GImpact mesh vertices before doing a postUpdate().
when i looked at the concave demo which does a deforming ground collision with some rigid bodies it seems to use BtBvhTriangleMesh and just does a setValue on the mesh vertices before calling partialRefitTree() on the shape.
i would very much appreciate it if you could let me know a similar procedure for a GImpact shape. I would like to update all the vertices of the mesh and not just a part of it.
thank you very much.
ram
Updating GImpact shape verts for colliding deforming objects
-
ramsampath
- Posts: 19
- Joined: Fri Sep 05, 2008 8:54 pm
-
Flix
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: Updating GImpact shape verts for colliding deforming obj
I thought that you could just do the same with GImpact and call postUpdate()...ramsampath wrote:when i looked at the concave demo which does a deforming ground collision with some rigid bodies it seems to use BtBvhTriangleMesh and just does a setValue on the mesh vertices before calling partialRefitTree() on the shape.
well, actually there are methods in the btStridingInterface that lock/unlock the vertex data, but I think they just expose the vertices that you can keep a reference to (the btStridingInterface does not clone the vertex data as far as I know).
You may try both ways and see what happens...
Some other tips I can think of:
1) Try to slightly modify some existing and working GImpact demo: this way it's easier to find out where problems are..
2) I assume you have enabled the GImpact collision algorithm with:
Code: Select all
btCollisionDispatcher * dispatcher = static_cast<btCollisionDispatcher *>(m_dynamicsWorld ->getDispatcher());
btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher);4) I don't think that the GImpact shape ctr takes the maximum possible aabb as an argument, but you may check it.
Good luck
-
ramsampath
- Posts: 19
- Joined: Fri Sep 05, 2008 8:54 pm
Re: Updating GImpact shape verts for colliding deforming obj
thank you flix, I will try your suggestions and post my findings when i have them. Yes, I had registered the GImpact collision algorithm.
ram.
ram.