Hi, I have to display the current motor RPM, how can I get it from the motor helper class ? Is it related to mEngineTorque or rather to the torque calculated in simulate method ?

Also what the "( 0.5f * 2000.0f)" constant part of the torque formula stand for ?

Thanks for any help.

Hi, I did it in nxOgre 0.9. I read some papers on gearbox and motor. I found relation between wheel and motor torque. I do not take care of wheel differential yet.

EngineRPM = WheelRPM*ratioCurrentGear

Then I compute at each frame wheel RPM in NxOgre::NxOgreShapeWheel::simulate()

NxReal mLastWRA = mWheelRollAngle;

mWheelRPM = (abs(mLastWRA - mWheelRollAngle) * mWheel->getRadius()*60)/dt;

But to calculte engine torque at a defined engine RPM I do not know exactly how to do it. If you have a torque curve for your car(found in a car's magazine) you can find equation with a software like mapple. But to simplify equation I do not kow how yet.

Today I do this:

mEngineTorque = mAcceleration - mEngineRpm/1000;

torque = mEngineTorque * mGear[mCurrentGear];

for(Wheels::Iterator i = Drive->items.begin();i != Drive->items.end();++i) {

(*i)->setMotorTorque(torque);

}

BloodyFanatic

23-10-2007 14:45:50

Then I compute at each frame wheel RPM in NxOgre::NxOgreShapeWheel::simulate()

much easier:

(NxWheelShape )->getAxleSpeed() / NxTwoPi * 60.0f;

there you have the wheel rotation in RPM

But to calculte engine torque at a defined engine RPM I do not know exactly how to do it. If you have a torque curve for your car(found in a car's magazine) you can find equation with a software like mapple. But to simplify equation I do not kow how yet.

take a closer look at this:

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=5404
in ageias sample is a good implementation of a torque curve ( i use it ^^)

Yes I did it in first time. But when you do not apply torque on wheel then axleSpeed is set to 0. And even if wheel turn.

axleSpeed seems to be torque dependent. Maybe I am wrong.

BloodyFanatic

23-10-2007 17:27:05

Yes I did it in first time. But when you do not apply torque on wheel then axleSpeed is set to 0. And even if wheel turn.

axleSpeed seems to be torque dependent. Maybe I am wrong.

It works for me quite good

Maybe you've set "axle_speed_override" to true.