inverted 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
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

inverted Gravity

Post by VeneX »

Is there a way to use inverted Gravity?
I use it for jumping/flying, with the Gravity to the sky, the camera starts slowly and becomes flying faster like Gravity, but is there a way to start fast and go slower and slower till it nearly stands still (and than I can set the Gravity to the floor so it will fall back). like throwing something in the air (like a ball)
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Guest

Post by Guest »

another question: this doesn't work ofcourse because device isn't made jet but how to do?

Code: Select all

device = createDevice(video::EDT_DIRECTX9, device->getVideoModeList()->getDesktopResolution()
		/*core::dimension2d<s32>(1024, 768)*/, 32, true, false, false, this);
	//device->createDeviceEx(SIrrlichtCreationParameters::AntiAlias(D3DMULTISAMPLE_2_SAMPLES, true));
and I tried AntiAliasing but I have no idea how it works.
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

that was me :oops:
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

So, let's say you have some gravity constant G...
...Would not inverted gravity be -G?
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

Code: Select all

if(!jumping)
		{	collider->setGravity(core::vector3df(0, 0.002f, 0));
			jumping = true;
		}
you ment this? but like this way you begin to 'fall in the sky' faster and faster, but I just want it reversed
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Foole
Posts: 87
Joined: Mon Aug 29, 2005 10:08 am

Post by Foole »

I think the word you're after is 'momentum'. You will probably have to implement it manually. Just subtract (gravity per ms x ms elapsed) from it each update.
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

Foole's right, gravity is acceleration, it cause momentum, which is what you're looking for. Don't expect to be able to do something like just set a gravity value and have the engine take care of everything else, Irrlicht wasn't made for that. Try using Newton if you want that kind of effect. Inverting gravity is not a good way to implement jumping in my opinion. When you jump, you press your feet against the ground and exert a force on it. The fact that you leave the ground is because the ground pushes back, with an equal force that you exert on it, pushing you into the air. Gravity is still in effect, it's what eventually pulls you back down. Now, you don't want to simulate all of that when you jump, it's overkill for a game. The simple thing that is happening is when you jump, a force pushes you up. This force is in the opposite direction of gravity. Irrlicht doesn't simulate forces, and gravity is really a convenience it offers to allow realistic movement over landscapes.
Post Reply