Ground Collision Detection

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
Scelle
Posts: 1
Joined: Thu Apr 12, 2007 3:23 am

Ground Collision Detection

Post by Scelle »

My character seems to get stuck on the ground on a flat space when running around my world and I cant figure why. The world was created in Terrain Generator and exported as a .obj file and I'm using the following code:
Yes most of it is from the tutorials :)

ITriangleSelector* selector = 0;

if (lvlNode)
{
...

selector = smgr->createOctTreeTriangleSelector(level->getMesh(0), lvlNode, 128);
lvlNode->setTriangleSelector(selector);
selector->drop();
}

node = smgr->addAnimatedMeshSceneNode( mesh );

...

aabbox3d<f32> box = node->getBoundingBox();
vector3df radius = box.MaxEdge - box.getCenter();


ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, node, radius,
vector3df(0,-2,0),
vector3df(0,0,0));
node->addAnimator(anim);
anim->drop();


When running downhill or up steep hills it seems to be fine, but its when the character runs over slightly bumpy terrain it gets stuck for some reason. Can anyone explain why and possibly help me stop it so she runs smoothly?
-There is no right or wrong, but thinking that makes it so-
HondaDarrell
Posts: 20
Joined: Sun Aug 27, 2006 9:10 pm
Location: U.S.A.
Contact:

Post by HondaDarrell »

I have this problem aswell. I also notice with my custom movement control that when the user hits a wall the user goes through and snaps back.
Is there some method of solve these problems?
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

you wont fix it. irrlicht has very basic collision detection so dont expect much. if you want physics then use tokamak, ode, newton or physx ;)
HondaDarrell
Posts: 20
Joined: Sun Aug 27, 2006 9:10 pm
Location: U.S.A.
Contact:

Post by HondaDarrell »

I remember seeing a demo called "InfinateGame.zip" that seemed good at handling terrain clipping.
Does anyone remember the post for the example?
HondaDarrell
Posts: 20
Joined: Sun Aug 27, 2006 9:10 pm
Location: U.S.A.
Contact:

Post by HondaDarrell »

Ah I found it, but it doesn't include source.

http://www.wc3jass.com/asger/page.php?10
Conard
Posts: 1
Joined: Sat Apr 14, 2007 6:20 pm

Post by Conard »

Have a look at the WoW Camera Snippet. It has collision detection and gravity, it works well for me.
Post Reply