Question for a new project

Laughing_Gas

02-06-2008 03:14:33

Im working on a new project with gravity reversing as a key component. I'm using NxOgre at the moment, but im not sure its possible to do what I want with it, so I'm just going to ask this on the forums for all the physics wrappers. I need to be able to reverse gravity on one object at a time, but they still need to be able to interact with each other. So my question is basically can I do this with Bullet?

beaugard

02-06-2008 13:29:36

AFAIK gravity is applied just like any force in Bullet (probably in PhysX too), so you can do it yourself without losing any efficiency. Just set gravity to 0 and add a force to each active body every timestep (or every frame, but then you have to take the frame time into account since it is not constant - gravity*elapsedtime).

Alternatively I suppose you can add a force of 2*gravity*elapsedtime in the inverse direction of gravity, but this seems a bit hacky... might cause unstable simulation especially if your timestep/frametime is not the same as Bullets.