TREE COLLISION PROBLEM

fizzle

24-05-2006 00:26:40

I hava a problem with the tree collision, I have the ninja (convex hull) colliding with the ground (tree collision) i can apply forces to the ninja when he is in the air but when his feet collide with the ground i can no longer move him, he becomes immune to forces ... is that a common problem? I have walk set to 50 when i press W. Any help would be appreciated, Thanks.
P.S. the gravity appears as though the ninja is on mars is there more accurate way to do it?

void NewtonState::WalkF(OgreNewt::Body* body)
{
Ogre::Quaternion quat;
Ogre::Vector3 vec;
body->getPositionOrientation(vec,quat);
Ogre::Vector3 dir = quat * Ogre::Vector3::NEGATIVE_UNIT_Z;

//apply a simple gravity force.
float mass;
Ogre::Vector3 inertia;

body->getMassMatrix(mass, inertia);
Ogre::Vector3 force(0.0,-9.8,0);

force *= mass;

//add walk
dir*=walk*mass;
body->addForce( force );

}

fizzle

24-05-2006 00:49:37

it was a scale issue...seems to be good now

shoki

24-05-2006 01:02:32

Ok, you've a solution, but if you still have a problem, call setAutoFreeze (0). And else, if your movement is not smooth, look at the collision. Then you can setup elasticity and friction between two kinds of materials (body groups).
See you,
shoki