move a character in a close world

hushhush

09-06-2009 16:01:10

Hello !

I'm actually coding a game, and i want to move my charater in a closed world.
I set all friction and restitution to ZERO (else he stamble). But when it hit a wall, the character bounce.

If someone knows how to change it, and if they are other things to know for move corectly a character

that's the code i use to move it:


NxOgre::Real3 r;
r.x = pos.x;
r.y = pos.y;
r.z = pos.z;
this->body->addForce(r, NxOgre::Enums::ForceMode_Impulse);


and this for friction and restitution


this->nxScene->getMaterial(0)->setStaticFriction(0.0f);
this->nxScene->getMaterial(0)->setDynamicFriction(0.0f);
this->nxScene->getMaterial(0)->setRestitution(0.f);

betajaen

09-06-2009 16:25:53

The materials don't have a significant impact on collision response like that.

I would either;

- Increase the linear (and probably angular) damping.
- Look into implementing collision response callbacks.
- Use intersections to detect collisions in a particular direction, and deny any movement against it. (This how the character controller works).