Help - Collisions/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
howkerman
Posts: 18
Joined: Mon Sep 14, 2009 1:47 pm
Location: Planet Earth

Help - Collisions/Gravity

Post by howkerman »

Hi there, I wanna start a RPG. I got a character scene node and a following camera. But I did some collisions and gravity:

Code: Select all

ISceneNodeAnimator* anim = mSceneManager->createCollisionResponseAnimator(
			selector, character, vector3df(1,1,1),
			vector3df(0,-10,0),
			vector3df(0,0,0));
		character->addAnimator(anim);
		anim->drop();
But it almost CAN'T walk on the heightmap terrain. It always get stuck and if I scale the "collisionsphere" up, it works a little better, but it makes the character fly in the air.
How can I fix this?
Amen
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

your createCollisionResponseAnimator is only 1 float radius ? :O
Working on game: Marrbles (Currently stopped).
howkerman
Posts: 18
Joined: Mon Sep 14, 2009 1:47 pm
Location: Planet Earth

Post by howkerman »

serengeor wrote:your createCollisionResponseAnimator is only 1 float radius ? :O
If I make it too big the character will float above the terrain
Amen
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

So your character height is 2floats ?
You could try to set the debug data to see the collision sphere.
Working on game: Marrbles (Currently stopped).
howkerman
Posts: 18
Joined: Mon Sep 14, 2009 1:47 pm
Location: Planet Earth

Post by howkerman »

serengeor wrote:So your character height is 2floats ?
You could try to set the debug data to see the collision sphere.
how?
Amen
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

This may be what you're looking for:

http://irrlicht.sourceforge.net/docu/cl ... c139bf9de7
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

Post by Alpha Omega »

Your in luck because I was just testing collisions with the irrlicht methods. Your problem is your level is scaled very small which is not a bad thing just need to compensate for it. Depending on how small your level is scaled you will need to make the ellipsoid smaller and smaller until you get the results you want. You said that making

Code: Select all

vector3df(1,1,1)
smaller that it improved results right? Then just keep going small try .5, then .05 and so on until you get the results that are best for your map. Also might want to place ur node up a little bit as indicated by the third vector3df function argument. How is the gravity scaled? Can you jump? Try it and see how fast you fall, my bet is it is very rapid descent. :D
Post Reply