To summarize the paragraph below: Is there any way to add a thickness (volume) or extend the collision detection range on a btBvhTriangleMeshShape?
I've created a btBvhTriangleMeshShape and set it as my static ground rigid body, I do this this similar to the appVehicleDemo project included with Bullet. I'm having a problem with fast moving objects tunneling through the terrain though. The objects are hitting the terrain pretty fast, though nothing crazy, think rockets fired from an aircraft. I'm only seeing about 5% of the rockets actually bounce off the ground when they hit. I wrote a collision detection function to see if they were all passing through or if there was actually collisions. The collision detection is being done at the end of every simulation step by parsing though all the contacts within the btParsistentManifold. From what I'm seeing I get about 85% of the rockets reporting 1 to 2 collisions before they completely pass through the terrain, the remaining 15% simply pass through the terrain with no report of collision. My guess is that the terrain mesh is thin enough that these (relatively) small objects are traveling too fast to make a consistent collision with the terrain "skin." My idea was to either give the terrain some actual volume or maybe expand the collision detection range. Obviously in the end the rockets are not actually going to be bouncing off of anything, the collision report will be used to remove the rocket and add an explosion, but I'd feel a lot better if I had more like 90%-95% of my rockets bouncing off the terrain before I start adding in the "explosion code." Does anyone have any suggestions/recommendations?
Thanks
ic
btBvhTriangleMeshShape and tunneling
-
David20321
- Posts: 17
- Joined: Sat Mar 13, 2010 10:08 pm
Re: btBvhTriangleMeshShape and tunneling
Disclaimer: I only started using Bullet a few days ago and may not know what I'm talking about.
However, I am also using a btBvhTriangleMeshShape for my ground terrain. One thing I noticed is that triangle collision seems to be two-sided. That is, if your rocket is more than halfway through the terrain, then Bullet may collide against the opposite side of your terrain triangle and push your rocket the rest of the way through.
For your case, you might be better off enabling swept collision (using setCcdSweptSphereRadius and setCcdMotionThreshold). I've heard that sometimes objects get 'stuck' to things using swept collisions, but that shouldn't be a problem if your rockets explode on impact. Other possibilities would be to use the btHeightfieldTerrainShape which I assume is solid, use smaller physics timesteps, or decompose the terrain into convex hulls.
However, I am also using a btBvhTriangleMeshShape for my ground terrain. One thing I noticed is that triangle collision seems to be two-sided. That is, if your rocket is more than halfway through the terrain, then Bullet may collide against the opposite side of your terrain triangle and push your rocket the rest of the way through.
For your case, you might be better off enabling swept collision (using setCcdSweptSphereRadius and setCcdMotionThreshold). I've heard that sometimes objects get 'stuck' to things using swept collisions, but that shouldn't be a problem if your rockets explode on impact. Other possibilities would be to use the btHeightfieldTerrainShape which I assume is solid, use smaller physics timesteps, or decompose the terrain into convex hulls.