[ODE] gravity per object?

Erwin de Vries erwin at vo.com
Wed Mar 24 12:20:34 MST 2004


There is a gravity disable function, so there's no need to invert the
gravity. I dont know its name, but i assume it is dBodyEnableGravity() or
something. Check the docs.

----- Original Message ----- 
From: "Lukas Henschke" <henschke at 4head.de>
To: "ODE Mailinglist" <ode at q12.org>
Sent: Wednesday, March 24, 2004 11:36 AM
Subject: Re: [ODE] gravity per object?


> > I'm wanting to set a seperate gravity direction on each object....
> > is this possible with ODE?
>
> A simple way would be the following (not tested):
>
> - get the global gravity (dWorldGetGravity)
> - invert it
> - for each object define a new gravity direction
> - add the inverted gravity
> - for each frame add a force (dBodyAddForce) with the components of the
new
> gravity vector
>
> (desired gravity direction)   <----/\  (inverted gravity)
> (force direction)                   |\     |
>                                              \    |
>                                               \   |
>                                                \  |
>                                                 \ |
>                                                  \|
>                                                   |
>                                                   |
>                                                   |
>                                                   |
>                                                   |
>                                                   |
>                                                  \/ (global gravity)
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>



More information about the ODE mailing list