PxVehiclePhysxActorKeepAwakeCheck

Defined in include/vehicle2/physxActor/PxVehiclePhysXActorFunctions.h

void PxVehiclePhysxActorKeepAwakeCheck(const PxVehicleAxleDescription &axleDescription, const PxVehicleArrayData<const PxVehicleWheelParams> &wheelParams, const PxVehicleArrayData<const PxVehicleWheelRigidBody1dState> &wheelRigidBody1dStates, const PxReal wakeCounterThreshold, const PxReal wakeCounterResetValue, const PxVehicleGearboxState *gearState, const PxReal *throttle, PxRigidBody &physxActor)

Check if the physx actor has to be kept awake.

Certain criteria should keep the vehicle physx actor awake, for example, if the (mass normalized) rotational kinetic energy of the wheels is above a certain threshold or if a gear change is pending or if throttle is applied. This method will reset the wake counter of the physx actor to a specified value, if any of the mentioned criteria are met.

Note

The physx actor’s sleep threshold will be used as threshold to test against for the energy criteria.

Parameters
  • axleDescription[in] identifies the wheels on each axle.

  • wheelParams[in] describes the radius, mass etc. of the wheels.

  • wheelRigidBody1dStates[in] describes the angular speed of the wheels.

  • wakeCounterThreshold[in] Once the wake counter of the physx actor falls below this threshold, the method will start testing if the wake counter needs to be reset.

  • wakeCounterResetValue[in] The value to set the physx actor wake counter to, if any of the criteria to do so are met.

  • gearState[in] The gear state. Can be set to NULL if the vehicle does not have gears or if the mentioned behavior is not desired.

  • throttle[in] The throttle command state (see PxVehicleCommandState). Can be set to NULL if the vehicle is not controlled through PxVehicleCommandState or if the mentioned behavior is not desired.

  • physxActor[in] is the PxRigidBody instance associated with the vehicle.