body torque applied by frictionless collision??

Arcanor

13-04-2007 21:03:01

I've setup my character body to have material Dynamic, and all landscape objects to have material Static. The material pair was setup so that when Dynamic items collide with Static items, they should have no friction at all. Here is how I create my materials:

void ArcWorldMgr::CreateMaterials(void)
{
mMatStatic = new OgreNewt::MaterialID(mWorld);
mMatDynamic = new OgreNewt::MaterialID(mWorld);

mMatPairDynamicDynamic = new OgreNewt::MaterialPair(mWorld, mMatDynamic, mMatDynamic);
mMatPairDynamicDynamic->setDefaultCollidable(0);

mMatPairStaticDynamic = new OgreNewt::MaterialPair(mWorld, mMatStatic, mMatDynamic);
mMatPairStaticDynamic->setDefaultCollidable(1);
mMatPairStaticDynamic->setDefaultElasticity(0.0f);
mMatPairStaticDynamic->setDefaultFriction(0.0f, 0.0f);
}

This works just fine when I apply a force to move my character in my custom force callback. However, when I use setVelocity() instead of addForce(), my character is no longer able to "slide along a wall", but instead there's a torque being applied which turns the character to face the wall. I don't understand how this torque is being applied, and I'd like to get rid of it.

One clue I have found is that my character's body is an ellipsoid. If I set the body to be a cylinder, the problem is much less apparent (although it still happens, just to a lesser degree).

Is this a bug? How can my character body be turning if it's rubbing against a frictionless surface?

leakingpear

19-04-2007 23:32:33

I'm having the very same problem and any help would be fantastic Walaber, it's also causing the character body to grind up vertical walls for me.

edit: Somehow fixed my problem, are you sure you're applying the materials to the bodies? I'm using the default material and a special character material and it's working fine now.