[ODE] Suitability to my application

David McClurg dmcclurg at pandemicstudios.com.au
Sun Aug 25 22:18:01 2002


I think the gamasutra article Andy posted earlier is very relevant.  I struggled with how to implement player control with ODE and setting velocity (and zeroing angular velocity) every frame seems to be a good solution.

---
Positioning the player by setting velocity is a reasonably happy medium between the total physics-unfriendliness of setting position and the loose control provided by forces. Rather than saying what position you want to be in each frame, calculate how fast you need to be moving to reach your target position and set the velocity on your physics body accordingly.

This has many of the same benefits as forces. If your character hits a wall, he'll either stop or slide along it. If he steps off a cliff, he'll start to fall, and if he hits a slope he'll climb up it. Little rises and falls in the ground will be automatically incorporated into your character's movement, and you still have pretty tight frame-to-frame control of your character's movement; he won't go flying off down a hill if you're setting his speed each frame, and you won't get an unfortunate confluence of external influences causing him to fly through the air.
---

-----Original Message-----
From: Anselm Hook [mailto:anselm@hook.org]
Sent: Thursday, 22 August 2002 2:36 PM
To: ode@q12.org
Subject: [ODE] gamasutra article re physics: maclaurin_01.htm

http://www.gamasutra.com/features/20020816/maclaurin_01.htm

-----Original Message-----
From: Anselm Hook [mailto:anselm@hook.org]
Sent: Saturday, 24 August 2002 9:35 PM
To: David Wills
Cc: ode@q12.org
Subject: Re: [ODE] Suitability to my application



The question you're asking is one that is genuinely an issue I believe.
There does seem to be a real tension between controlled behavior driven by
say story like aspects of your game and what physics will want to do.

No answers for you but basically your comments speak about a real issue -
it is hard to constrain physical objects to behave in animated like ways.

You'll probably have to try some clever hacks to have your cake and eat it
too.


 - a

On Sat, 24 Aug 2002, [iso-8859-1] David Wills wrote:

> Hi everyone, this is probably a *very* difficult
> question to answer, so sorry if it sounds like a silly
> question or I don't give enough information..
>
> What I want to know is whether ODE will be suitable
> for the 3d engine I am currently developing, and
> trying to integrate physics into. I have spent a few
> days playing with ODE, which is why I'm asking..
>
> I have managed to integrate ODE with my engine fairly
> well (I already had a RigidBody interface that I could
> pretty much fit ODE directly into..) but I'm having a
> bit of trouble getting .. desirable .. results.
>
> For instance, (I did do some physics at uni but I have
> forgotten most of it), I would have thought that
> applying a force directly through an object's centre
> of mass should result in pure translation, but what
> often happens is the object falls over and seems to
> begin rolling uncontrollably..
>
> Now this may well be the correct response (maybe it
> has something to do with the collision contacts the
> object is making with the ground mesh), but it's not
> much use when I am trying to get a simple
> translation..
>
> I guess what I am saying is, although I want real
> physics in that the character can interact (eg roll
> boxes realistically etc), I also need to be able to
> restrict the physics of some objects fairly heavily so
> that it is easy for a player to control etc..
>
> It is very easy to make the integrator go unstable and
> assert if I change variables manually (obviously), but
> is there simple ways to constrain things like the
> rotation objects can undergo on certain axes but still
> be able to rotate on other axes and move freely
> otherwise??
>
> Sorry if that's a bit long winded, I'll try and
> explain a bit better if it's not clear what I mean..
>
> Thanks for any help
> David