13 #ifndef PX_VEHICLE_CONTROL_H
14 #define PX_VEHICLE_CONTROL_H
30 void testValidAnalogValue(
const PxF32 actualValue,
const PxF32 minVal,
const PxF32 maxVal,
const char* errorString);
85 mRawDigitalInputs[i]=
false;
86 mRawAnalogInputs[i]=0.0f;
166 testValidAnalogValue(accel, 0.0f, 1.0f,
"Analog accel must be in range (0,1)");
178 testValidAnalogValue(brake, 0.0f, 1.0f,
"Analog brake must be in range (0,1)");
187 void setAnalogHandbrake(
const PxReal handbrake)
190 testValidAnalogValue(handbrake, 0.0f, 1.0f,
"Analog handbrake must be in range (0,1)");
202 testValidAnalogValue(steer, -1.0f, 1.0f,
"Analog steer must be in range (-1,1)");
234 void setGearUp(
const bool gearUpKeyPressed) {mGearUp=gearUpKeyPressed;}
240 void setGearDown(
const bool gearDownKeyPressed) {mGearDown=gearDownKeyPressed;}
277 const bool isVehicleInAir,
294 const bool isVehicleInAir,
324 const bool isVehicleInAir,
341 const bool isVehicleInAir,
358 mRawAnalogInputs[i]=0.0f;
359 mRawDigitalInputs[i]=
false;
445 void setAnalogAccel(
const PxF32 accel)
448 testValidAnalogValue(accel, 0.0f, 1.0f,
"Tank analog accel must be in range (-1,1)");
458 void setAnalogLeftThrust(
const PxF32 leftThrust)
463 testValidAnalogValue(leftThrust, -1.0f, 1.0f,
"Tank left thrust must be in range (-1,1) in eSPECIAL mode.");
467 testValidAnalogValue(leftThrust, 0.0f, 1.0f,
"Tank left thrust must be in range (0,1) in eSTANDARD mode.");
478 void setAnalogRightThrust(
const PxF32 rightThrust)
483 testValidAnalogValue(rightThrust, -1.0f, 1.0f,
"Tank right thrust must be in range (-1,1) in eSPECIAL mode.");
487 testValidAnalogValue(rightThrust, 0.0f, 1.0f,
"Tank right thrust must be in range (0,1) in eSTANDARD mode.");
498 void setAnalogLeftBrake(
const PxF32 leftBrake)
501 testValidAnalogValue(leftBrake, 0.0f, 1.0f,
"Tank left brake must be in range (0,1).");
511 void setAnalogRightBrake(
const PxF32 rightBrake)
514 testValidAnalogValue(rightBrake, 0.0f, 1.0f,
"Tank right brake must be in range (0,1).");
634 #endif //PX_VEHICLE_CONTROL_H