[ODE] gravity per object?

Jonas Svegland svegland at customred.com
Wed Mar 24 12:10:40 MST 2004


Yes thats one way to do it...
...or you could use the following function and parameters... 
dBodySetGravityMode (dBodyID, 0) ...to disable the influence of world 
gravity and then add your own gravity force.

http://opende.sourceforge.net/ode-latest-userguide.html#ref42

cheers
---
Jonas Svegland
svegland at customred.com



Lukas Henschke wrote:

>>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