I got it fixed
The engine part is what I am looking at.
Looking at the script version when you start the engine the rpm built up and when you turn it off. It slowly goes down.
On this though it is instant off/on. And when I apply throttle it the rpm raises fast. in the script it raises slowly.
Here is where the rotors are spun:
double dt = oapiGetSimStep();
main_rotor_anim_state = std::fmod((main_rotor_anim_state + (rpm_comm * (dt / 60))), 1);
when running it rpm and rpm.comm are the same value
VECTOR3 vHorizonAirspeedVector = { 0 };
GetHorizonAirspeedVector(vHorizonAirspeedVector);
double airspeed = vHorizonAirspeedVector.z;
if (engine_on == true) {
rpm_comm = min_rpm + throttle_level * (max_rpm - min_rpm);
}
else if (engine_on == false && GroundContact() == false) {
// rpm_comm = 0.5 * engine_spec.max_rpm;
rpm_comm = ((2 * 7 * airspeed / main_rotor_spec.diameter) * (60 / (2 * PI)));
}
else if (engine_on == false && GroundContact()) {
rpm_comm = 0;
}
int max_rpm = 2050; //maximum engine speed (rpm)
int min_rpm = 750; //idle engine speed (rpm)
throttle level is main thrust level
As I understand turn the engine on no throttle
rpm_comm = min_rpm + throttle_level * (max_rpm - min_rpm);
rpm_comm = 750 + 0*(2050-750) so rpm_comm = 750 and at full throttle 2650
But should it built up to 750 or down if engine on/off?