Collision detection taking too much time
-
- Posts: 3
- Joined: Mon May 05, 2014 11:43 pm
Collision detection taking too much time
I have a softbody with 2500 triangles in it and a Rigid body with 6900 triangles. My collision detection between these two bodies is taking too much time. I am using btBvhTriangleMeshShape(mTriMesh, true) for rigid body triangles, and broadphase = new btDbvtBroadphase(); as a broadphase. Size of softbody is 4 cross 4, Rigid body is a human mesh model. Please help me and tell why it is taking too much time to detect collision?
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: Collision detection taking too much time
Ever considered that's just far too many triangles for the system to handle? You're trying to send full fat rendering models into a physics engine, and that just isn't going to work. To make matters worse, you have a softbody object, and without GPU acceleration those calculations are just impossible in realtime for that many triangles (without completely rewriting the bullet components for softbody calculation and collisions). Try taking both down an order of magnitude or more in face count, then it might work as intended, or you could try other optimizations like rewriting collision detection.