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?
Ground Collision Detection
Ground Collision Detection
-There is no right or wrong, but thinking that makes it so-
-
- Posts: 20
- Joined: Sun Aug 27, 2006 9:10 pm
- Location: U.S.A.
- Contact:
-
- Posts: 20
- Joined: Sun Aug 27, 2006 9:10 pm
- Location: U.S.A.
- Contact:
-
- Posts: 20
- Joined: Sun Aug 27, 2006 9:10 pm
- Location: U.S.A.
- Contact:
Have a look at the WoW Camera Snippet. It has collision detection and gravity, it works well for me.