Should I use split impulse?

feedbrian
Posts: 9
Joined: Thu Feb 19, 2009 12:22 am

Should I use split impulse?

Post by feedbrian »

From my reading on the forum here, it sounds like split impulse gives better energy conservation for elastic collisions but doesn't work as well as the default constraint solver for joints. I'm interested in physical correctness and I don't use explicit constraints--so would enabling split impulse be a good idea in my situation?

On the same note, is there anything else I could tweak inside Bullet to increase the physical accuracy of the simulation? (Other than reducing the time step, of course.) Performance isn't an issue for me. In fact, my application doesn't seem to generate obviously unphysical behavior, so maybe I should phrase the question in a less confrontational way: what, if any, are the important approximations that Bullet makes to achieve high performance?

My background is in computer science and to a lesser degree magnetics... so please bear with my ignorance!

Thanks,
Brian
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Should I use split impulse?

Post by Dirk Gregorius »

See this for a discussion on split impulse and other stabilization methods: http://www.gphysics.com/archives/35

Pseudo velocities and split impulses are the same. Actually Baumgarte stabilization can also be physically correct, but this depends on the choice of parameters and it can be indeed energetic. So saying one method is more physical correct than the other is difficult. Also note that the requirements on a *game* physic engine are absolutely different than in e.g. engineering.


HTH,
-Dirk
feedbrian
Posts: 9
Joined: Thu Feb 19, 2009 12:22 am

Re: Should I use split impulse?

Post by feedbrian »

Dirk Gregorius wrote:See this for a discussion on split impulse and other stabilization methods: http://www.gphysics.com/archives/35

Pseudo velocities and split impulses are the same. Actually Baumgarte stabilization can also be physically correct, but this depends on the choice of parameters and it can be indeed energetic. So saying one method is more physical correct than the other is difficult. Also note that the requirements on a *game* physic engine are absolutely different than in e.g. engineering.
So split impulses aren't really "better" than Baumgarte... I'll stick with the default for now and revisit this if I run into problems later. Thanks for the reply.

Cheers,
Brian
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Should I use split impulse?

Post by Erwin Coumans »

If you enable split impulse, it will only affect contact constraints with deep penetrations. Split impulse is not implemented for non-contact joints.

It is a matter of preference, some games use split impulse others don't. I would try out both ways and choose which one you like best. Baumgarte sometimes adds unwanted energy/velocity due to deep penetration correction.

Other ways to increase quality of the simulation is increasing the number of constraint solver iterations:

Code: Select all

dynamicsWorld->getSolverInfo().m_numIterations = 20;
or try changing the friction model settings (see btSolverMode in Bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h)

Code: Select all

world->getSolverInfo().m_solverMode = SOLVER_SIMD + SOLVER_USE_WARMSTARTING + SOLVER_RANDMIZE_ORDER + SOLVER_USE_2_FRICTION_DIRECTIONS;
There are other ways, but this could be a starting point.

Hope this helps,
Erwin
feedbrian
Posts: 9
Joined: Thu Feb 19, 2009 12:22 am

Re: Should I use split impulse?

Post by feedbrian »

Thanks, Erwin, I'll try these out.