Classes | |
class | PxVehicleChassisData |
class | PxVehicleEngineData |
class | PxVehicleGearsData |
class | PxVehicleAutoBoxData |
class | PxVehicleDifferential4WData |
class | PxVehicleDifferentialNWData |
class | PxVehicleAckermannGeometryData |
struct | PxVehicleClutchAccuracyMode |
Choose between a potentially more expensive but more accurate solution to the clutch model or a potentially cheaper but less accurate solution. More... | |
class | PxVehicleClutchData |
class | PxVehicleTireLoadFilterData |
Tire load variation can be strongly dependent on the time-step so it is a good idea to filter it to give less jerky handling behavior. More... | |
class | PxVehicleWheelData |
class | PxVehicleSuspensionData |
class | PxVehicleTireData |
class | PxVehicleDriveSimData |
Data structure describing non-wheel configuration data of a vehicle that has engine, gears, clutch, and auto-box. More... | |
class | PxVehicleDriveDynData |
Data structure with instanced dynamics data for vehicle with engine, clutch, gears, autobox. More... | |
class | PxVehicleDrive |
A complete vehicle with instance dynamics data and configuration data for wheels and engine,clutch,gears,autobox. More... | |
class | PxVehicleDriveSimData4W |
Data structure describing the drive model components of a vehicle with up to 4 driven wheels and up to 16 un-driven wheels. The drive model incorporates engine, clutch, gears, autobox, differential, and Ackermann steer correction. More... | |
struct | PxVehicleDrive4WWheelOrder |
The ordering of the driven and steered wheels of a PxVehicleDrive4W. More... | |
struct | PxVehicleDrive4WControl |
The control inputs for a PxVehicleDrive4W. More... | |
class | PxVehicleDrive4W |
Data structure with instanced dynamics data and configuration data of a vehicle with up to 4 driven wheels and up to 16 non-driven wheels. More... | |
class | PxVehicleDriveSimDataNW |
Data structure describing configuration data of a vehicle with up to PX_MAX_NB_WHEELS driven equally through the differential. The vehicle has an engine, clutch, gears, autobox, differential. More... | |
struct | PxVehicleDriveNWControl |
The control inputs for a PxVehicleDriveNW. More... | |
class | PxVehicleDriveNW |
Data structure with instanced dynamics data and configuration data of a vehicle with up to PX_MAX_NB_WHEELS driven wheels. More... | |
struct | PxVehicleDriveTankWheelOrder |
The ordering of the wheels of a PxVehicleDriveTank. More... | |
struct | PxVehicleDriveTankControl |
The control inputs for a PxVehicleDriveTank. More... | |
struct | PxVehicleDriveTankControlModel |
Two driving models are supported. More... | |
class | PxVehicleDriveTank |
Data structure with instanced dynamics data and configuration data of a tank. More... | |
class | PxVehicleNoDrive |
Data structure with instanced dynamics data and configuration data of a vehicle with no drive model. More... | |
struct | PxVehicleTypes |
struct | PxVehicleConcreteType |
An enumeration of concrete vehicle classes inheriting from PxBase. More... | |
struct | PxVehicleUpdateMode |
struct | PxVehicleDrivableSurfaceType |
Driving surface type. Each PxMaterial is associated with a corresponding PxVehicleDrivableSurfaceType. More... | |
class | PxVehicleDrivableSurfaceToTireFrictionPairs |
Friction for each combination of driving surface type and tire type. More... | |
struct | PxWheelQueryResult |
Structure containing data describing the non-persistent state of each suspension/wheel/tire unit. This structure is filled out in PxVehicleUpdates and PxVehicleUpdateSingleVehicleAndStoreTelemetryData. More... | |
struct | PxVehicleWheelQueryResult |
struct | PxVehicleWheelConcurrentUpdateData |
Structure containing data that is computed for a wheel during concurrent calls to PxVehicleUpdates but which cannot be safely concurrently applied. More... | |
struct | PxVehicleConcurrentUpdateData |
Structure containing data that is computed for a vehicle and its wheels during concurrent calls to PxVehicleUpdates but which cannot be safely concurrently applied. More... | |
struct | PxVehicleKeySmoothingData |
Used to produce smooth vehicle driving control values from key inputs. More... | |
struct | PxVehiclePadSmoothingData |
Used to produce smooth analog vehicle control values from analog inputs. More... | |
class | PxVehicleDrive4WRawInputData |
Used to produce smooth vehicle driving control values from analog and digital inputs. More... | |
class | PxVehicleDriveNWRawInputData |
Used to produce smooth vehicle driving control values from analog and digital inputs. More... | |
class | PxVehicleDriveTankRawInputData |
Used to produce smooth analog tank control values from analog and digital inputs. More... | |
class | PxVehicleCopyDynamicsMap |
Used by PxVehicleCopyDynamicsData. More... | |
class | PxVehicleWheelsSimData |
Data structure describing configuration data of a vehicle with up to 20 wheels. More... | |
class | PxVehicleWheelsDynData |
Data structure with instanced dynamics data for wheels. More... | |
class | PxVehicleWheels |
Data structure with instanced dynamics data and configuration data of a vehicle with just wheels. More... | |
Macros | |
#define | PX_MAX_NB_WHEELS (20) |
This number is the maximum number of wheels allowed for a vehicle. More... | |
#define | PX_DEBUG_VEHICLE_ON (1) |
Compiler setting to enable recording of telemetry data. More... | |
Typedefs | |
typedef void(* | PxVehicleComputeTireForce )(const void *shaderData, const PxF32 tireFriction, const PxF32 longSlip, const PxF32 latSlip, const PxF32 camber, const PxF32 wheelOmega, const PxF32 wheelRadius, const PxF32 recipWheelRadius, const PxF32 restTireLoad, const PxF32 normalisedTireLoad, const PxF32 tireLoad, const PxF32 gravity, const PxF32 recipGravity, PxF32 &wheelTorque, PxF32 &tireLongForceMag, PxF32 &tireLatForceMag, PxF32 &tireAlignMoment) |
Prototype of shader function that is used to compute wheel torque and tire forces. More... | |
Functions | |
PX_COMPILE_TIME_ASSERT (0==(sizeof(PxVehicleChassisData)&0x0f)) | |
PX_C_EXPORT bool PX_CALL_CONV | PxInitVehicleSDK (PxPhysics &physics, PxSerializationRegistry *serializationRegistry=NULL) |
Initialize the PhysXVehicle library. More... | |
PX_C_EXPORT void PX_CALL_CONV | PxCloseVehicleSDK (PxSerializationRegistry *serializationRegistry=NULL) |
Shut down the PhysXVehicle library. More... | |
void | PxVehicleSetBasisVectors (const PxVec3 &up, const PxVec3 &forward) |
Set the basis vectors of the vehicle simulation. More... | |
void | PxVehicleSetUpdateMode (PxVehicleUpdateMode::Enum vehicleUpdateMode) |
Set the effect of PxVehicleUpdates to be either to modify each vehicle's rigid body actor. More... | |
void | PxVehicleSuspensionRaycasts (PxBatchQuery *batchQuery, const PxU32 nbVehicles, PxVehicleWheels **vehicles, const PxU32 nbSceneQueryResults, PxRaycastQueryResult *sceneQueryResults, const bool *vehiclesToRaycast=NULL) |
Perform raycasts for all suspension lines for all vehicles. More... | |
void | PxVehicleUpdates (const PxReal timestep, const PxVec3 &gravity, const PxVehicleDrivableSurfaceToTireFrictionPairs &vehicleDrivableSurfaceToTireFrictionPairs, const PxU32 nbVehicles, PxVehicleWheels **vehicles, PxVehicleWheelQueryResult *vehicleWheelQueryResults, PxVehicleConcurrentUpdateData *vehicleConcurrentUpdates=NULL) |
Update an array of vehicles by either applying an acceleration to the rigid body actor associated with each vehicle or by an immediate update of the velocity of the actor. More... | |
void | PxVehiclePostUpdates (const PxVehicleConcurrentUpdateData *vehicleConcurrentUpdates, const PxU32 nbVehicles, PxVehicleWheels **vehicles) |
Apply actor changes that were computed in concurrent calls to PxVehicleUpdates but which could not be safely applied due to the concurrency. More... | |
void | PxVehicleShiftOrigin (const PxVec3 &shift, const PxU32 nbVehicles, PxVehicleWheels **vehicles) |
Shift the origin of vehicles by the specified vector. More... | |
bool | PxVehicleIsInAir (const PxVehicleWheelQueryResult &vehWheelQueryResults) |
Test if all wheels of a vehicle are in the air by querying the wheel query data stored in the last call to PxVehicleUpdates. If all wheels are in the air then true is returned. More... | |
void | PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs (const PxVehicleKeySmoothingData &keySmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDrive4WRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDrive4W &focusVehicle) |
Used to smooth and set analog vehicle control values (accel,brake,handbrake,steer) from digital inputs (keyboard). Also used to set boolean gearup, geardown values. More... | |
void | PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs (const PxVehiclePadSmoothingData &padSmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDrive4WRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDrive4W &focusVehicle) |
Used to smooth and set analog vehicle control values from analog inputs (gamepad). Also used to set boolean gearup, geardown values. More... | |
void | PxVehicleDriveNWSmoothDigitalRawInputsAndSetAnalogInputs (const PxVehicleKeySmoothingData &keySmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDriveNWRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDriveNW &focusVehicle) |
Used to smooth and set analog vehicle control values (accel,brake,handbrake,steer) from digital inputs (keyboard). Also used to set boolean gearup, geardown values. More... | |
void | PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs (const PxVehiclePadSmoothingData &padSmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDriveNWRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDriveNW &focusVehicle) |
Used to smooth and set analog vehicle control values from analog inputs (gamepad). Also used to set boolean gearup, geardown values. More... | |
void | PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs (const PxVehicleKeySmoothingData &keySmoothing, const PxVehicleDriveTankRawInputData &rawInputData, const PxReal timestep, PxVehicleDriveTank &focusVehicle) |
Used to smooth and set analog tank control values from digital inputs (keyboard). Also used to set boolean gearup, geardown values. More... | |
void | PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs (const PxVehiclePadSmoothingData &padSmoothing, const PxVehicleDriveTankRawInputData &rawInputData, const PxReal timestep, PxVehicleDriveTank &focusVehicle) |
Used to smooth and set analog tank control values from analog inputs (gamepad). Also used to set boolean gearup, geardown values. More... | |
void | PxVehicle4WEnable3WTadpoleMode (PxVehicleWheelsSimData &wheelsSimData, PxVehicleWheelsDynData &wheelsDynData, PxVehicleDriveSimData4W &driveSimData) |
Reconfigure a PxVehicle4W instance as a three-wheeled car with tadpole config (2 front wheels, 1 rear wheel) More... | |
void | PxVehicle4WEnable3WDeltaMode (PxVehicleWheelsSimData &wheelsSimData, PxVehicleWheelsDynData &wheelsDynData, PxVehicleDriveSimData4W &driveSimData) |
Reconfigure a PxVehicle4W instance as a three-wheeled car with delta config (1 front wheel, 2 rear wheels) More... | |
void | PxVehicleComputeSprungMasses (const PxU32 nbSprungMasses, const PxVec3 *sprungMassCoordinates, const PxVec3 ¢reOfMass, const PxReal totalMass, const PxU32 gravityDirection, PxReal *sprungMasses) |
Compute the sprung masses of the suspension springs given given (i) the number of sprung masses, (ii) coordinates of the sprung masses, (iii) the center of mass offset of the rigid body, (iv) the total mass of the rigid body, and (v) the direction of gravity (0 for x-axis, 1 for y-axis, 2 for z-axis). More... | |
void | PxVehicleUpdateCMassLocalPose (const PxTransform &oldCMassLocalPose, const PxTransform &newCMassLocalPose, const PxU32 gravityDirection, PxVehicleWheels *vehicle) |
Reconfigure the vehicle to reflect a new center of mass local pose that has been applied to the actor. The function requires (i) the center of mass local pose that was last used to configure the vehicle and the vehicle's actor, (ii) the new center of mass local pose that has been applied to the vehicle's actor and will now be applied to the vehicle, and (iii) the direction of gravity (0 for x-axis, 1 for y-axis, 2 for z-axis) More... | |
void | PxVehicleCopyDynamicsData (const PxVehicleCopyDynamicsMap &wheelMap, const PxVehicleWheels &src, PxVehicleWheels *trg) |
Copy dynamics data from src to trg, including wheel rotation speed, wheel rotation angle, engine rotation speed etc. More... | |
#define PX_DEBUG_VEHICLE_ON (1) |
Compiler setting to enable recording of telemetry data.
#define PX_MAX_NB_WHEELS (20) |
This number is the maximum number of wheels allowed for a vehicle.
Referenced by PxVehicleCopyDynamicsMap::PxVehicleCopyDynamicsMap(), and PxVehicleDifferentialNWData::PxVehicleDifferentialNWData().
typedef void(* PxVehicleComputeTireForce)(const void *shaderData, const PxF32 tireFriction, const PxF32 longSlip, const PxF32 latSlip, const PxF32 camber, const PxF32 wheelOmega, const PxF32 wheelRadius, const PxF32 recipWheelRadius, const PxF32 restTireLoad, const PxF32 normalisedTireLoad, const PxF32 tireLoad, const PxF32 gravity, const PxF32 recipGravity, PxF32 &wheelTorque, PxF32 &tireLongForceMag, PxF32 &tireLatForceMag, PxF32 &tireAlignMoment) |
Prototype of shader function that is used to compute wheel torque and tire forces.
[in] | shaderData | is the shader data for the tire being processed. The shader data describes the tire data in the format required by the tire model that is implemented by the shader function. |
[in] | tireFriction | is the value of friction for the contact between the tire and the ground. |
[in] | longSlip | is the value of longitudinal slip experienced by the tire. |
[in] | latSlip | is the value of lateral slip experienced by the tire. |
[in] | camber | is the camber angle of the tire in radians. |
[in] | wheelOmega | is the rotational speed of the wheel. |
[in] | wheelRadius | is the distance from the tire surface to the center of the wheel. |
[in] | recipWheelRadius | is the reciprocal of wheelRadius. |
[in] | restTireLoad | is the load force experienced by the tire when the vehicle is at rest. |
[in] | normalisedTireLoad | is a pre-computed value equal to the load force on the tire divided by restTireLoad. |
[in] | tireLoad | is the load force currently experienced by the tire (= restTireLoad*normalisedTireLoad) |
[in] | gravity | is the magnitude of gravitational acceleration. |
[in] | recipGravity | is the reciprocal of the magnitude of gravitational acceleration. |
[out] | wheelTorque | is the torque that is to be applied to the wheel around the wheel's axle. |
[out] | tireLongForceMag | is the magnitude of the longitudinal tire force to be applied to the vehicle's rigid body. |
[out] | tireLatForceMag | is the magnitude of the lateral tire force to be applied to the vehicle's rigid body. |
[out] | tireAlignMoment | is the aligning moment of the tire that is to be applied to the vehicle's rigid body (not currently used). |
PX_COMPILE_TIME_ASSERT | ( | 0 | = =(sizeof(PxVehicleChassisData)&0x0f) | ) |
PX_C_EXPORT void PX_CALL_CONV PxCloseVehicleSDK | ( | PxSerializationRegistry * | serializationRegistry = NULL | ) |
Shut down the PhysXVehicle library.
Call this function as part of the physx shutdown process.
serializationRegistry | PxSerializationRegistry instance, if non-NULL must be the same as passed into PxInitVehicleSDK. |
PX_C_EXPORT bool PX_CALL_CONV PxInitVehicleSDK | ( | PxPhysics & | physics, |
PxSerializationRegistry * | serializationRegistry = NULL |
||
) |
Initialize the PhysXVehicle library.
Call this before using any of the vehicle functions.
physics | The PxPhysics instance. |
serializationRegistry | PxSerializationRegistry instance, if NULL vehicle serialization is not supported. |
void PxVehicle4WEnable3WDeltaMode | ( | PxVehicleWheelsSimData & | wheelsSimData, |
PxVehicleWheelsDynData & | wheelsDynData, | ||
PxVehicleDriveSimData4W & | driveSimData | ||
) |
Reconfigure a PxVehicle4W instance as a three-wheeled car with delta config (1 front wheel, 2 rear wheels)
[in,out] | wheelsSimData | is the data describing the wheels/suspensions/tires of the vehicle. |
[in,out] | wheelsDynData | is the data describing the dynamic state of the wheels of the vehicle. |
[in,out] | driveSimData | is the data describing the drive model of the vehicle. |
void PxVehicle4WEnable3WTadpoleMode | ( | PxVehicleWheelsSimData & | wheelsSimData, |
PxVehicleWheelsDynData & | wheelsDynData, | ||
PxVehicleDriveSimData4W & | driveSimData | ||
) |
Reconfigure a PxVehicle4W instance as a three-wheeled car with tadpole config (2 front wheels, 1 rear wheel)
[in,out] | wheelsSimData | is the data describing the wheels/suspensions/tires of the vehicle. |
[in,out] | wheelsDynData | is the data describing the dynamic state of the wheels of the vehicle. |
[in,out] | driveSimData | is the data describing the drive model of the vehicle. |
void PxVehicleComputeSprungMasses | ( | const PxU32 | nbSprungMasses, |
const PxVec3 * | sprungMassCoordinates, | ||
const PxVec3 & | centreOfMass, | ||
const PxReal | totalMass, | ||
const PxU32 | gravityDirection, | ||
PxReal * | sprungMasses | ||
) |
Compute the sprung masses of the suspension springs given given (i) the number of sprung masses, (ii) coordinates of the sprung masses, (iii) the center of mass offset of the rigid body, (iv) the total mass of the rigid body, and (v) the direction of gravity (0 for x-axis, 1 for y-axis, 2 for z-axis).
[in] | nbSprungMasses | is the number of sprung masses of the vehicle. This value corresponds to the number of wheels on the vehicle. |
[in] | sprungMassCoordinates | are the coordinates of the sprung masses relative to the actor. The array sprungMassCoordinates must be of length nbSprungMasses or greater. |
[in] | centreOfMass | is the coordinate of the center of mass of the rigid body relative to the actor. This value corresponds to the value set by PxRigidBody::setCMassLocalPose. |
[in] | totalMass | is the total mass of all the sprung masses. This value corresponds to the value set by PxRigidBody::setMass. |
[in] | gravityDirection | is an integer describing the direction of gravitational acceleration. A value of 0 corresponds to (-1,0,0), a value of 1 corresponds to (0,-1,0) and a value of 2 corresponds to (0,0,-1). |
[out] | sprungMasses | are the masses to set in the associated suspension data with PxVehicleSuspensionData::mSprungMass. The sprungMasses array must be of length nbSprungMasses or greater. Each element in the sprungMasses array corresponds to the suspension located at the same array element in sprungMassCoordinates. The center of mass of the masses in sprungMasses with the coordinates in sprungMassCoordinates satisfy the specified centerOfMass. |
void PxVehicleCopyDynamicsData | ( | const PxVehicleCopyDynamicsMap & | wheelMap, |
const PxVehicleWheels & | src, | ||
PxVehicleWheels * | trg | ||
) |
Copy dynamics data from src to trg, including wheel rotation speed, wheel rotation angle, engine rotation speed etc.
[in] | wheelMap | - describes the mapping between the wheels in src and the wheels in trg. |
[in] | src | - according to the wheel mapping stored in wheelMap, the dynamics data in src wheels are copied to the corresponding wheels in trg. |
[out] | trg | - according to wheel mapping stored in wheelMap, the wheels in trg are given the dynamics data of the corresponding wheels in src. |
void PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs | ( | const PxVehiclePadSmoothingData & | padSmoothing, |
const PxFixedSizeLookupTable< 8 > & | steerVsForwardSpeedTable, | ||
const PxVehicleDrive4WRawInputData & | rawInputData, | ||
const PxReal | timestep, | ||
const bool | isVehicleInAir, | ||
PxVehicleDrive4W & | focusVehicle | ||
) |
Used to smooth and set analog vehicle control values from analog inputs (gamepad). Also used to set boolean gearup, geardown values.
[in] | padSmoothing | describes how quickly the control values applied to the vehicle blend from the current vehicle values towards the raw analog values from the gamepad. |
[in] | steerVsForwardSpeedTable | is a table of maximum allowed steer versus forward vehicle speed. |
[in] | rawInputData | is the state of all gamepad analog inputs that will be used control the vehicle. |
[in] | timestep | is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs |
[in] | isVehicleInAir | describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable. |
[in] | focusVehicle | is the vehicle that will be given analog control values arising from the gamepad inputs. |
void PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs | ( | const PxVehicleKeySmoothingData & | keySmoothing, |
const PxFixedSizeLookupTable< 8 > & | steerVsForwardSpeedTable, | ||
const PxVehicleDrive4WRawInputData & | rawInputData, | ||
const PxReal | timestep, | ||
const bool | isVehicleInAir, | ||
PxVehicleDrive4W & | focusVehicle | ||
) |
Used to smooth and set analog vehicle control values (accel,brake,handbrake,steer) from digital inputs (keyboard). Also used to set boolean gearup, geardown values.
[in] | keySmoothing | describes the rise and fall rates of the corresponding analog values when keys are pressed on and off. |
[in] | steerVsForwardSpeedTable | is a table of maximum allowed steer versus forward vehicle speed. |
[in] | rawInputData | is the state of all digital inputs that control the vehicle. |
[in] | timestep | is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs |
[in] | isVehicleInAir | describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable. |
[in] | focusVehicle | is the vehicle that will be given analog and gearup/geardown control values arising from the digital inputs. |
void PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs | ( | const PxVehiclePadSmoothingData & | padSmoothing, |
const PxFixedSizeLookupTable< 8 > & | steerVsForwardSpeedTable, | ||
const PxVehicleDriveNWRawInputData & | rawInputData, | ||
const PxReal | timestep, | ||
const bool | isVehicleInAir, | ||
PxVehicleDriveNW & | focusVehicle | ||
) |
Used to smooth and set analog vehicle control values from analog inputs (gamepad). Also used to set boolean gearup, geardown values.
[in] | padSmoothing | describes how quickly the control values applied to the vehicle blend from the current vehicle values towards the raw analog values from the gamepad. |
[in] | steerVsForwardSpeedTable | is a table of maximum allowed steer versus forward vehicle speed. |
[in] | rawInputData | is the state of all gamepad analog inputs that will be used control the vehicle. |
[in] | timestep | is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs |
[in] | isVehicleInAir | describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable. |
[in] | focusVehicle | is the vehicle that will be given analog control values arising from the gamepad inputs. |
void PxVehicleDriveNWSmoothDigitalRawInputsAndSetAnalogInputs | ( | const PxVehicleKeySmoothingData & | keySmoothing, |
const PxFixedSizeLookupTable< 8 > & | steerVsForwardSpeedTable, | ||
const PxVehicleDriveNWRawInputData & | rawInputData, | ||
const PxReal | timestep, | ||
const bool | isVehicleInAir, | ||
PxVehicleDriveNW & | focusVehicle | ||
) |
Used to smooth and set analog vehicle control values (accel,brake,handbrake,steer) from digital inputs (keyboard). Also used to set boolean gearup, geardown values.
[in] | keySmoothing | describes the rise and fall rates of the corresponding analog values when keys are pressed on and off. |
[in] | steerVsForwardSpeedTable | is a table of maximum allowed steer versus forward vehicle speed. |
[in] | rawInputData | is the state of all digital inputs that control the vehicle. |
[in] | timestep | is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs |
[in] | isVehicleInAir | describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable. |
[in] | focusVehicle | is the vehicle that will be given analog and gearup/geardown control values arising from the digital inputs. |
void PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs | ( | const PxVehiclePadSmoothingData & | padSmoothing, |
const PxVehicleDriveTankRawInputData & | rawInputData, | ||
const PxReal | timestep, | ||
PxVehicleDriveTank & | focusVehicle | ||
) |
Used to smooth and set analog tank control values from analog inputs (gamepad). Also used to set boolean gearup, geardown values.
[in] | padSmoothing | describes how quickly the control values applied to the vehicle blend from the current vehicle values towards the raw analog values from the gamepad. |
[in] | rawInputData | is the state of all gamepad analog inputs that will be used control the vehicle. |
[in] | timestep | is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs |
[in] | focusVehicle | is the vehicle that will be given analog control values arising from the gamepad inputs. |
void PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs | ( | const PxVehicleKeySmoothingData & | keySmoothing, |
const PxVehicleDriveTankRawInputData & | rawInputData, | ||
const PxReal | timestep, | ||
PxVehicleDriveTank & | focusVehicle | ||
) |
Used to smooth and set analog tank control values from digital inputs (keyboard). Also used to set boolean gearup, geardown values.
[in] | keySmoothing | describes the rise and fall rates of the corresponding analog values when keys are pressed on and off. |
[in] | rawInputData | is the state of all digital inputs that control the vehicle. |
[in] | timestep | is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs |
[in] | focusVehicle | is the vehicle that will be given analog and gearup/geardown control values arising from the digital inputs. |
bool PxVehicleIsInAir | ( | const PxVehicleWheelQueryResult & | vehWheelQueryResults | ) |
Test if all wheels of a vehicle are in the air by querying the wheel query data stored in the last call to PxVehicleUpdates. If all wheels are in the air then true is returned.
void PxVehiclePostUpdates | ( | const PxVehicleConcurrentUpdateData * | vehicleConcurrentUpdates, |
const PxU32 | nbVehicles, | ||
PxVehicleWheels ** | vehicles | ||
) |
Apply actor changes that were computed in concurrent calls to PxVehicleUpdates but which could not be safely applied due to the concurrency.
[in] | vehicleConcurrentUpdates | is an array of length nbVehicles where vehicleConcurrentUpdates[i] contains data describing actor changes that were computed for vehicles[i] during concurrent calls to PxVehicleUpdates. |
[in] | nbVehicles | is the number of vehicles pointers in the vehicles array |
[in,out] | vehicles | is an array of length nbVehicles containing all vehicles that were partially updated in concurrent calls to PxVehicleUpdates. |
Set the basis vectors of the vehicle simulation.
Default values PxVec3(0,1,0), PxVec3(0,0,1)
Call this function before using PxVehicleUpdates unless the default values are correct.
void PxVehicleSetUpdateMode | ( | PxVehicleUpdateMode::Enum | vehicleUpdateMode | ) |
Set the effect of PxVehicleUpdates to be either to modify each vehicle's rigid body actor.
with an acceleration to be applied in the next PhysX SDK update or as an immediate velocity modification.
Default behavior is immediate velocity modification.
Call this function before using PxVehicleUpdates for the first time if the default is not the desired behavior.
void PxVehicleShiftOrigin | ( | const PxVec3 & | shift, |
const PxU32 | nbVehicles, | ||
PxVehicleWheels ** | vehicles | ||
) |
Shift the origin of vehicles by the specified vector.
Call this method to adjust the internal data structures of vehicles to reflect the shifted origin location (the shift vector will get subtracted from all world space spatial data).
[in] | shift | is the translation vector to shift the origin by. |
[in] | nbVehicles | is the number of vehicles in the vehicles array. |
[in,out] | vehicles | is an array of all vehicles that should be updated to map to the new scene origin. |
void PxVehicleSuspensionRaycasts | ( | PxBatchQuery * | batchQuery, |
const PxU32 | nbVehicles, | ||
PxVehicleWheels ** | vehicles, | ||
const PxU32 | nbSceneQueryResults, | ||
PxRaycastQueryResult * | sceneQueryResults, | ||
const bool * | vehiclesToRaycast = NULL |
||
) |
Perform raycasts for all suspension lines for all vehicles.
[in] | batchQuery | is a PxBatchQuery instance used to specify shader data and functions for the raycast scene queries. |
[in] | nbVehicles | is the number of vehicles in the vehicles array. |
[in] | vehicles | is an array of all vehicles that are to have a raycast issued from each wheel. |
[in] | nbSceneQueryResults | must be greater than or equal to the total number of wheels of all the vehicles in the vehicles array; that is, sceneQueryResults must have dimensions large enough for one raycast hit result per wheel for all the vehicles in the vehicles array. |
[in] | sceneQueryResults | must persist without being overwritten until the end of the next PxVehicleUpdates call. |
[in] | vehiclesToRaycast | is an array of bools of length nbVehicles that is used to decide if raycasts will be performed for the corresponding vehicle in the vehicles array. If vehiclesToRaycast[i] is true then suspension line raycasts will be performed for vehicles[i]. If vehiclesToRaycast[i] is false then suspension line raycasts will not be performed for vehicles[i]. |
void PxVehicleUpdateCMassLocalPose | ( | const PxTransform & | oldCMassLocalPose, |
const PxTransform & | newCMassLocalPose, | ||
const PxU32 | gravityDirection, | ||
PxVehicleWheels * | vehicle | ||
) |
Reconfigure the vehicle to reflect a new center of mass local pose that has been applied to the actor. The function requires (i) the center of mass local pose that was last used to configure the vehicle and the vehicle's actor, (ii) the new center of mass local pose that has been applied to the vehicle's actor and will now be applied to the vehicle, and (iii) the direction of gravity (0 for x-axis, 1 for y-axis, 2 for z-axis)
[in] | oldCMassLocalPose | is the center of mass local pose that was last used to configure the vehicle. |
[in] | newCMassLocalPose | is the center of mass local pose that will be used to configure the vehicle so that it matches the vehicle's actor. |
[in] | gravityDirection | is an integer describing the direction of gravitational acceleration. A value of 0 corresponds to (0,0,-1), a value of 1 corresponds to (0,-1,0) and a value of 2 corresponds to (0,0,-1). |
[in,out] | vehicle | is the vehicle to be updated with a new center of mass local pose. |
void PxVehicleUpdates | ( | const PxReal | timestep, |
const PxVec3 & | gravity, | ||
const PxVehicleDrivableSurfaceToTireFrictionPairs & | vehicleDrivableSurfaceToTireFrictionPairs, | ||
const PxU32 | nbVehicles, | ||
PxVehicleWheels ** | vehicles, | ||
PxVehicleWheelQueryResult * | vehicleWheelQueryResults, | ||
PxVehicleConcurrentUpdateData * | vehicleConcurrentUpdates = NULL |
||
) |
Update an array of vehicles by either applying an acceleration to the rigid body actor associated with each vehicle or by an immediate update of the velocity of the actor.
[in] | timestep | is the timestep of the update |
[in] | gravity | is the value of gravitational acceleration |
[in] | vehicleDrivableSurfaceToTireFrictionPairs | describes the mapping between each PxMaterial ptr and an integer representing a surface type. It also stores the friction value for each combination of surface and tire type. |
[in] | nbVehicles | is the number of vehicles pointers in the vehicles array |
[in,out] | vehicles | is an array of length nbVehicles containing all vehicles to be updated by the specified timestep |
[out] | vehicleWheelQueryResults | is an array of length nbVehicles storing the wheel query results of each corresponding vehicle and wheel in the vehicles array. A NULL pointer is permitted. |
[out] | vehicleConcurrentUpdates | is an array of length nbVehicles. It is only necessary to specify vehicleConcurrentUpdates if PxVehicleUpdates is called concurrently. The element vehicleWheelQueryResults[i] of the array stores data that is computed for vehicle[i] during PxVehicleUpdates but which cannot be safely written when concurrently called. The data computed and stored in vehicleConcurrentUpdates must be passed to PxVehiclePostUpdates, where it is applied to all relevant actors in sequence. A NULL pointer is permitted. |