[ODE] Pushing through collisions

Jon Watte hplus-ode at mindcontrol.org
Sun May 2 08:55:54 MST 2004



It's now becoming clearer. I think this will happen to anyone who implements forces that apply each step. Here's what's happening:

1) player pushes into object
2) detect penetration
3) resolve ERP percentage of penetration, causing delta-v out of object
4) apply controller force which changes delta-v to be into project again
5) goto 1, except we're slightly deeper into the object

The key is 4): the force applied is enough to change the direction of travel to be into the object again, such that the next penetration position is further into the object. It doesn't take a whole lot to get a slow sinking into the object.

Since I didn't want to set ERP to 1.0, and because I already use a low CFM of 1e-4, I added a "displacement" float property to my physical entities. When a contact is generated, I look at this property, and set soft_erp to world_erp minus displacement. I also accumulate normal * depth * displacement into a displacement vector for the object. When all collision is done, I then displace the object by the accumulated displacement vector. There's a few more details, but that's the gist of it.

For my parameters, using displacement of 0.2 or 0.3 is enough to avoid sinking into the object. This is a little bit surprising, as I'll get a smaller delta-v adjustment, but apparently the guaranteed movement part is much more important than the delta-v part at these small values.

An alternate, game design work-around would be to detect lateral collisions, and cut off player input for a little while (probably playing a "bump into" animation). I think Tomb Raider did this when you walked into things, for example. That makes pushing things much harder, though (Tomb Raider only had special-case pushable things) which makes the world less physical.

Cheers,

				/ h+


-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Jon
Watte
Sent: Thursday, April 29, 2004 5:15 PM
To: Russ Smith
Cc: ODE at q12.org
Subject: RE: Re[2]: [ODE] Pushing through collisions



Allright, so one-over-time-step is the only contact scaler. Now I have 
all the information I need to go off and experiment. Thanks!

Cheers,

			/ h+






More information about the ODE mailing list