my model is skating in the world

ShUdDeR

23-04-2008 16:40:12

Hi!

I'm using trianglemeshgeometry to set my terrain as ground. I have a model and the collisions over the ground are OK. The problem i have is that model is skating over the ground. There is any kind of function to control the friction of the model and the ground??

thxx

rewb0rn

23-04-2008 18:34:55

There are setters for the parameters in the contact class. I described those that I tested here: http://www.ogre3d.org/wiki/index.php/Og ... Parameters

ShUdDeR

24-04-2008 22:45:08

CollisionListener have this code:


bool WorldManager::collision(OgreOde::Contact* contact)
{
OgreOde::Geometry * const g1 = contact->getFirstGeometry();
OgreOde::Geometry * const g2 = contact->getSecondGeometry();

if (g1 && g2)
{
const OgreOde::Body * const b1 = g1->getBody();
const OgreOde::Body * const b2 = g2->getBody();
if (b1 && b2 && OgreOde::Joint::areConnected(b1, b2))
return false;
}
contact->setCoulombFriction(OgreOde::Utility::Infinity);
contact->setBouncyness(0.1);
return true;
}



You have to pass to the function Collision() an object with type "Contact". Wich function returns an object with type "Contact"??

I'm a bit disoriented. Thankss 4 your help

rewb0rn

24-04-2008 23:25:31

ah no the tutorial covers more advanced topics and you do not need to care. your collision method is fine for what you want to do. Now just try to change the forcedependentslip in your contact object. allthough i did not experience skating objects with the default value, it could be the reason, because it sets the "slippyness" of your object.

edit: or do you not even have a collision method? then yes you should get one. refer to the samplescenes demo for a complete implementation.