$OpenBSD$ --- source/vdrift/cardynamics_simulate.cpp.orig Tue Aug 6 05:57:30 2013 +++ source/vdrift/cardynamics_simulate.cpp Fri Aug 9 17:33:35 2013 @@ -104,8 +104,8 @@ MATHVECTOR CARDYNAMICS::UpdateSuspension(int i, suspension[WHEEL_POSITION(otheri)].GetDisplacement() ); //suspension[WHEEL_POSITION(i)].SetAntiRollInfo(antirollforce); - if (isnan( antirollforce )) antirollforce = 0.f; //crash dyn obj- - assert(!isnan( antirollforce )); + if (std::isnan( antirollforce )) antirollforce = 0.f; //crash dyn obj- + assert(!std::isnan( antirollforce )); //find the vector direction to apply the suspension force #ifdef SUSPENSION_FORCE_DIRECTION @@ -225,7 +225,7 @@ void CARDYNAMICS::ApplyWheelTorque(Dbl dt, Dbl drive_t //set wheel torque due to tire rolling resistance Dbl rolling_resistance = wheel.GetRollingResistance(wheel.GetAngularVelocity(), wheel_contact[i].GetSurface().rollingResist); Dbl tire_rolling_resistance_torque = - rolling_resistance * wheel.GetRadius(); //- tire_friction_torque; - //assert(!isnan(tire_rolling_resistance_torque)); + //assert(!std::isnan(tire_rolling_resistance_torque)); //LogO(fToStr(wheel_torque, 4,9)+" r "+fToStr(tire_rolling_resistance_torque, 4,9)); wheel.SetTorque(wheel_torque*0.5 + tire_rolling_resistance_torque); @@ -287,7 +287,7 @@ void CARDYNAMICS::ApplyClutchTorque(Dbl engine_drag, D void CARDYNAMICS::CalculateDriveTorque(Dbl * wheel_drive_torque, Dbl clutch_torque) { Dbl driveshaft_torque = transmission.GetTorque( clutch_torque ); - assert( !isnan(driveshaft_torque) ); + assert( !std::isnan(driveshaft_torque) ); for (int i = 0; i < WHEEL_POSITION_SIZE; ++i) wheel_drive_torque[i] = 0; @@ -315,7 +315,7 @@ void CARDYNAMICS::CalculateDriveTorque(Dbl * wheel_dri wheel_drive_torque[REAR_RIGHT] = diff_rear.GetSide2Torque(); } - for (int i = 0; i < WHEEL_POSITION_SIZE; ++i) assert(!isnan( wheel_drive_torque[WHEEL_POSITION(i)] )); + for (int i = 0; i < WHEEL_POSITION_SIZE; ++i) assert(!std::isnan( wheel_drive_torque[WHEEL_POSITION(i)] )); } Dbl CARDYNAMICS::CalculateDriveshaftSpeed() @@ -325,7 +325,7 @@ Dbl CARDYNAMICS::CalculateDriveshaftSpeed() Dbl whFR = wheel[FRONT_RIGHT].GetAngularVelocity(); Dbl whRL = wheel[REAR_LEFT].GetAngularVelocity(); Dbl whRR = wheel[REAR_RIGHT].GetAngularVelocity(); - for (int i = 0; i < 4; ++i) assert(!isnan( wheel[WHEEL_POSITION(i)].GetAngularVelocity() )); + for (int i = 0; i < 4; ++i) assert(!std::isnan( wheel[WHEEL_POSITION(i)].GetAngularVelocity() )); if (drive == RWD) driveshaft_speed = diff_rear.CalculateDriveshaftSpeed( whRL, whRR ); @@ -345,7 +345,7 @@ Dbl CARDYNAMICS::CalculateDriveshaftRPM() const Dbl whFR = wheel[FRONT_RIGHT].GetAngularVelocity(); Dbl whRL = wheel[REAR_LEFT].GetAngularVelocity(); Dbl whRR = wheel[REAR_RIGHT].GetAngularVelocity(); - for (int i = 0; i < 4; ++i) assert(!isnan( wheel[WHEEL_POSITION(i)].GetAngularVelocity() )); + for (int i = 0; i < 4; ++i) assert(!std::isnan( wheel[WHEEL_POSITION(i)].GetAngularVelocity() )); if (drive == RWD) driveshaft_speed = diff_rear.GetDriveshaftSpeed( whRL, whRR ); else if (drive == FWD) @@ -365,7 +365,7 @@ Dbl CARDYNAMICS::GetSpeedMPS() const Dbl whFR = wheel[FRONT_RIGHT].GetAngularVelocity(); Dbl whRL = wheel[REAR_LEFT].GetAngularVelocity(); Dbl whRR = wheel[REAR_RIGHT].GetAngularVelocity(); - for (int i = 0; i < 4; ++i) assert (!isnan(wheel[WHEEL_POSITION(i)].GetAngularVelocity())); + for (int i = 0; i < 4; ++i) assert (!std::isnan(wheel[WHEEL_POSITION(i)].GetAngularVelocity())); if (drive == RWD) return (whRL+whRR) * 0.5 * wheel[REAR_LEFT].GetRadius();