Flix wrote:However as far as I know the code above doesn't "move" the shape since it doesn't have a "position". How to do that?
Wait a minute.
Shapes cannot be moved. They can be shared by multiple rigid bodies/collision objects (but in case they're deformable it's usually better to keep a shape per object). The transform belongs to the object/body, not to the shape.
When you do raycasting you can do it in different ways (see the appRaytracer demo); you may try to change the way you do it.
You may also try to replicate the behaviour you're seeing in this demo
http://bulletphysics.org/Bullet/phpBB3/ ... =raytracer: it uses a btCollisionWorld like in your base code (maybe the default Bullet demo does the same...).
Basically what I'm trying to say is that:
1) You may be right. Maybe GImpact shapes in collision worlds can't be moved correctly (or by moving them raycast somehow breaks). In that case you may try to use btBvhTriangleMeshShapes only and see if it works...
2) You may be wrong and you did not move/raycast correctly.
I'm feeling too lazy to check it myself, sorry
P.S. Maybe you can try to manually update the AABB of the (GImpact) body after you've moved it.
P.S.2. It should be the default, but try setting:
Code: Select all
world->setForceUpdateAllAabbs(true);
(There is a method to manually update the aabb per object too, but I can't find it right now).