Dynamic simulation is slow and unstable

Typically: "How do I... ", "How can I... " questions
Post Reply
alphaUser
Posts: 19
Joined: 12 Feb 2013, 15:24

Dynamic simulation is slow and unstable

Post by alphaUser »

My simulation is quite slow and unstable: calculation seems to take long for dynamics calculation. In addition to that, the colliding objects react in a strange way (slightly jumping, even when they are supposed to be lying on the floor).

How can I improve speed and stability in that case?

Thanks

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Dynamic simulation is slow and unstable

Post by coppelia »

Hi,

Not sure whether this is your problem, but you probably are not using pure shapes.

A physics engine can simulate collision response between 3 types of shapes:

1) Random shapes (non-convex, polygon soups, etc.)
2) Convex shapes
3) pure shapes (primitive shapes: cuboids, spheres or cylinders. Sometimes other primitives too, like heightfields, etc.)

1) Random shapes should NEVER be used for collision response calculations, unless you have no other option. They are extremely slow and very unstable. What you can do, is make a convex decomposition of your random shape: this will result in a grouping of convex shapes (see next item). Refer also to the convex decomposition function in V-REP.
2) Convex shapes are already much better than random shapes, but they are still slower and less stable than pure shapes.
3) Pure shapes are very fast and stable. Whenever you can, use pure shapes to model the "respondable" items in your scene.

You can inspect the dynamic content of your scene DURING simulation, by clicking the "visualize dynamic content" toolbar button: each shape is color coded, and you can quickly find the culprit. Make sure you also read the design considerations 1, 2 & 3 here:

Cheers

Post Reply