few qestions about vehicle

OGL

19-04-2009 10:16:49

1.how to add material to wheels

I do this:
Ogre::Entity* carWheel_Enity = mSceneMgr->createEntity( "CarWheel_entity", "car_wheell.mesh");
Ogre::SceneNode* carWheel_sn = mSceneMgr->getRootSceneNode()->createChildSceneNode("CarWheel_node");
carWheel_sn->attachObject(carWheel_Enity);
carWheel_Enity->setMaterialName("car_wheel");


and everything is ok, but now I want to add this to my wheelset:
wheelSet = NxOgre::WheelSet::createFourWheelSet(0.5f, NxOgre::float3(1, -1, 2), NxOgre::float3(-1, -1, -2), mCarBody, wheelP, "model: car_wheell.mesh");
and I don now how...
2. how to check the car speed? I need it because I what to have reverse in my car...

I will be grateful for hints...

robindegen

19-04-2009 22:17:07

the way i calculate speed is by comparing the positions between frames. So i have it's previous position, and one frame later i have it's current position. With that i can do a simple 3d pythagoras to calculate distance, using frame time delta t to calculate speed.

betajaen

19-04-2009 23:52:25

There is a much easier solution.

// Velocity of the Actor in Kilometres per hour:
actor->getLinearVelocity().magnitude() * 3.6;

OGL

20-04-2009 10:31:40

Thx,
one problem solved, but do anyone can hel me with those wheel meshes ?

betajaen

20-04-2009 11:05:09

Not really an NxOgre Question but get the node/entities of the wheels and set it that way, or change the material permanently with meshmagick

OGL

11-05-2009 20:37:03

Hi,
please tell me which parameters will enhance adhesion of wheels?
I have somthing like this:
NxOgre::WheelParams wheelP;
wheelP.setToDefault();
wheelP.mMass = 1.0f;
wheelP.mLocalPose.t.set(0, 0, 0);
wheelP.mDensity = 100.0f;
wheelP.mLongitudalTireForceFunction.stiffnessFactor = 500000.0f;
wheelP.mLongitudalTireForceFunction.extremumSlip = 0.2f;
wheelP.mLongitudalTireForceFunction.asymptoteValue = 0.6f;
wheelP.mSuspension.spring = 2715.0f;
wheelP.mSuspension.damper = 1500;
wheelP.mSuspension.targetValue = 0.0f;
wheelP.mSuspensionTravel = 0.3f;

But when I turn the car seems to move sideways.

Another thing is that when I set Left and rigth wheel those in the back vihicle are in the same place, why is that?

thanks for your time...
Peace

OGL

13-05-2009 09:49:03

knock knock, is anyone there? :roll: