I observed that bullet physics StepSimulation is very very slow when a rigidbody with a TriangleMeshShape is fully inside a rigidbody with a simple BoxShape. I noticed that when I move the trianglemeshshape object a bit out of the boxshape my simulation started to run as fast as usual. How can i improve the performance for thats cenario? At some point in my simulation I have to test for all trianglemeshshapes are fully inside a boundingbox. So far i have to do the test on demand and cant just keep the boxshape in the simulation all the time.

I tried using ghostobjects but that didnt help to improve the performance. I assume that the problem lies with the inetrnal working of bullet physics and how the DynamicsWorld performs the collision testing.

Does anyone have an idea how to improve performance for many small trianglemeshShapes inside one big boxshape? all my shapes are kinematic.

  • \$\begingroup\$ I have only little experience with bullet physics. I haven't heard of testing that an object is inside another, only checking when an object is outside. So what if you used 6 boxes to mimic the single box and you checked if your mesh is outside of each of those? \$\endgroup\$ – Vaillancourt May 30 '19 at 12:03
  • \$\begingroup\$ I thought about splitting up into 6 outside boxes but that wouldn't help me either, because I do allow objects outside of the box at times. It's a placement application with a working area and at the end a test if all objects are inside. I just don't want to bother adding a rigidbody and removing it at the end. But I guess I have to. \$\endgroup\$ – D3d_dev May 30 '19 at 13:05
  • \$\begingroup\$ Usually I'd solve this by doing 6 plane checks. No plane colliders, just testing with 6 normal vectors and offsets. I don't know the Bullet API well enough to identify whether it has convenience methods for this though. \$\endgroup\$ – DMGregory May 30 '19 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.