Canceling gravity

TheBlindMaster

28-03-2009 20:27:39

Well I've got a question, I want to cancel gravity on an object without it becoming static. Well for exemple, I've got a tennis racquet wich would be able to float in the air. it's gotta have a mass, and obey some kind of physics, but since I want it to float in the air, I'd got to cancel the gravity

Well I've tried somethings.. adding an upward force of m*a (mass*9.80665) works.. if there's no modification in rotation done to de racquet, otherwise it either falls down or go up in the space.

I suppose that it's caused by the inertia, and the weight distribution, am I right, and how would I solve it. I am quite new to ogre and nxogre. so I don't know everything, is there such a getter for the getting the downward force applied to it and cancelling it??

Thanks a lot

spacegaier

28-03-2009 20:37:54

The first thing that comes to my mind: KinematicActors (but not totally sure).

betajaen

28-03-2009 21:38:46

If your using Bleeding, then you can raise the following flag (function is in Actor/Body)

NX_BF_DISABLE_GRAVITY

If your using Bloody Mess, I haven't implemented flags as of yet, you could introduce a force every frame to (-9.81 * actor->getMass()), like you've done.

Anything more than that, it's best to introduce some linear (and possibly angular) damping so it doesn't shoot off.