I'm using newton in truevision3d engine but i have a problem with making proper working gearbox.
I want to make a gearing for my vehicle simulator but i cannot make it right (like in real car) because i cannot set wheel angular velocity.
When i add vehicle wheels are not adding as a body - so i cannot set SetBodyAngularVelocity.
Only thing that left to my is SetTorque stuff that is not good for car simulator (only for one gear karts or some arcade radio controled vehicles or testing purposes).
As we know or not - in first gear wheels are spinning slowest but torque is highest. Every next gear lower max torque but higher max speed.
If you wanna make it in Newton by SetTorque - car will be accelerating only in 1st gear - in second torque will be lesser than in first so car will be slowing down.
For all others newton fighters - some ideas how can i make good gearing simulator with only SetTorque stuff so gears will be working like in real car?
P.S Code and explanation
My code of what your are talking about :
- Code: Select all
Car.WheelSpeed := physics.GetVehicleWheelAngularVelocity(car_id,2); // rear wheel (RWD)
Car.Engine_RPM := (Car.WheelSpeed * Car_Perf.final_gear_ratio * car_Perf.gear_ratio[car.gear] * 60) / (2 * PI);
Car.Torque_Engine := GetTorque(car.Engine_RPM) * car.Throttle;
Car.Torque_Drive := (Car.Torque_Engine * Car_Perf.final_gear_ratio * car_Perf.gear_ratio[car.gear]);
if (Car.Gear <> 0) and (car.Throttle > 0) then begin
physics.SetVehicleWheelTorque(car_ID, rlw,Car.Torque_Drive,0);
physics.SetVehicleWheelTorque(car_ID, rrw,Car.Torque_Drive,0);
end
taking Honda CRX for example
In first gear - redline 7600 rpm we get about 68 km/h and 1435 Nm
We are changing gear to second
Now we have got 4000 rpm and 953 Nm of torque ... so the car is slowing down because we apply less torque than in previous gear
I think that I explain that clear
Thanks for all advices!!