toggle gravity?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
WaxyChicken
Posts: 95
Joined: Sat Jun 25, 2011 6:15 am

toggle gravity?

Post by WaxyChicken »

I'm trying to figure out how to add/remove gravity to the FPS camera on demand.

As far as i can tell, you make 2 animators.

one animator is CreateCollisionResponseAnimator WITH gravity (Gravity = n )
the other animator is
CreateCollisionResponseAnimator WITHOUT gravity (Gravity = 0)

To toggle gravity ON you would

FPSCamera.RemoveAnimator (Collision Response Animator WITHOUT gravity)
FPSCamera.AddAnimator (Collision Response Animator WITH gravity)

and vice-versa to toggle gravity off.

is there a more efficient way other than adding and removing the entire world collision animators?

i haven't tried the method above yet but, not knowing the details of how animators are handled in Irrlicht, it sounds like it would be very cumbersome.

irrlicht 1.7.2 or irrlicht 1.8.0-Alpha (i can use either one if needed. release 1.7.2 is preferred)

(PS: i hope i'm making sense. i've been up a very long time)
_______________________________________________________
You could argue with me all day long about which language is best.
But what it comes down to is:
which language is best for YOU and which language is best for ME.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: toggle gravity?

Post by serengeor »

Uhm, there's :

Code: Select all

//! Sets the gravity of the environment.
                virtual void setGravity(const core::vector3df& gravity);
in ISceneNodeAnimatorCollisionResponse.
Working on game: Marrbles (Currently stopped).
Post Reply