set tire position?

r1cky17

06-12-2007 05:53:36

hi, i want to set the position of my tire and it's not match for my car that i made.
here is the picture of the car and the tire




i use this code to set the tire

Ogre::Vector3 offset(3.2, -0.5, 1.7); //untuk pingko --> titik tengah'e
Ogre::Vector3 tireOffset[4];

Ogre::Vector3 axis[2];
axis[0] = tireOffset[0]-tireOffset[1];
axis[1] = tireOffset[2]-tireOffset[3];

int tireNum = 0;
for (int x=-1;x<=1;x+=2)
{
for (int z=-1;z<=1;z+=2)
{
Ogre::Quaternion tireorient = Ogre::Quaternion(Ogre::Degree(0), Ogre::Vector3::UNIT_Y);
Ogre::Vector3 tirepos = offset * Ogre::Vector3(x,1,z); //untuk pingko
Ogre::Vector3 pin(0,0,x);

Ogre::Real mass = 100;
Ogre::Real width = 1.4;
Ogre::Real radius = 1.4;
Ogre::Real susShock = 30.0;
Ogre::Real susSpring = 50.0;
Ogre::Real susLength = 2;
bool steering;
tirepos.x-=0.5;
tirepos.z+=0.1;
Ogre::Entity* mTire = mSceneMgr->createEntity(mName + "Tire"+Ogre::StringConverter::toString(tireNum), mTireFileName);

Ogre::SceneNode* mTireNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
mTireNode->attachObject( mTire );
mTireNode->setScale( Ogre::Vector3(radius, radius, width) );

if (x > 0)
steering = true;
else
steering = false;

SimpleTire* tire = new SimpleTire(this, tireorient, tirepos, pin, mass, width, radius, susShock, susSpring, susLength, 0, steering);

tireNum++;
tire->attachToNode( mTireNode );
}
}
setTireFriction();


how to set the tire to match for the car body?
i already change the offset of the car but it still doesn't work