vehicle slip problem

yan007

25-04-2006 15:56:26

i have built a wheelchair, one problem my tires slip to much, i just want almost no slip

i tried with tire->setLongitudinalSlipCoefficient(..) but is has no effect?
where do you put this code (in the userCallback() ??)
should i use different functions (e.g. setMaxSideSlipSpeed)

could the sollution be de define the materials id's ??

walaber

25-04-2006 17:13:03

yeah... make the friction between the wheelchair material and the world material higher (like 2.0)... this will greatly increase the traction of the tires.

yan007

25-04-2006 19:25:25

1)how do i use Body->setMaterialGroupID(...) for the tires (OgreNewt::Vehicle::Tire) ?

if have no body for the tires ?

2) matPairRolstoelVloer = new OgreNewt::MaterialPair(m_World, matIDRolstoel, matIDVloer);
matPairRolstoelVloer->setDefaultFriction(2.0,1.8);

is it necessary to put this code somewhere special ?
is that enough or do i need callbacks?

yan007

25-04-2006 21:41:25

maybe i could use m_World->getDefaultMaterialID() for the tires,
but my materialpair doenst have any affect

walaber

26-04-2006 06:01:09

the tires are the same material as the RigidBody that makes the vehicle chassis. they are treated like members of a compound collision, as part of the main rigid body of the chassis.

yan007

26-04-2006 19:41:20

i tried with m_chassis->setMaterialGroupID(..) doenst work

but i found a sollution, the last parameter of the constructor of OgreNewt::Vehicle::Tire is "collision ID used to determine collision in material callbacks" so that problem is probably solved

but i cant get the material pair working (errors while starting ogre)

in demo 3 (OgreNewt) they use a Callback class,

my questions:
1)do i need i Callback class for the use of OgreNewt::MaterialPair
2)how does this Callback class looks like (and could i get information somewhere)
3)do i need to override functions from this Callback class
4)could it be something else why my code for the OgreNewt::MaterialPair
doesnt work

thx for help

walaber

26-04-2006 22:58:58

you only need a callback if you want advanced information. to just change the default friction, you don't need a callback.

but if you want to make a callback, yes you need to inherit from the OgreNewt::ContactCallback class, and create your own userBegin() userProcess() and userend() functions.

yan007

28-04-2006 16:12:02

i can debug but if i start the program i get an error

this is my code
in OgreNewtonApplication.h:
const OgreNewt::MaterialID* matIDLevel;
const OgreNewt::MaterialID* matIDWielen;
OgreNewt::MaterialPair* matPairLevelWielen;

in OgreNewtonApplication.cpp:
matIDWielen = 0; // the tires have collision ID 0
matIDLevel = new OgreNewt::MaterialID( m_World );
matPairLevelWielen = new OgreNewt::MaterialPair( m_World, matIDWielen, matIDLevel );
matPairLevelWielen->setDefaultFriction(0.8,0.8);

level1Body->setMaterialGroupID(matIDLevel);


with the 'search error' facility it point to matPairLevelWielen->setDefaultFriction(0.8,0.8);

walaber

28-04-2006 17:02:46

matIDWielen = 0; // the tires have collision ID 0

this line is wrong. you need to make a material here:

matIDWielen = new OgreNewt::MaterialGroupID(m_World);

and make sure you apply that material to the vehicle chassis.