PxVehiclePhysxActorWakeup

Defined in include/vehicle2/physxActor/PxVehiclePhysXActorFunctions.h

void PxVehiclePhysxActorWakeup(const PxVehicleCommandState &commands, const PxVehicleEngineDriveTransmissionCommandState *transmissionCommands, const PxVehicleGearboxParams *gearParams, const PxVehicleGearboxState *gearState, PxRigidBody &physxActor, PxVehiclePhysXSteerState &physxSteerState)

Wake up the physx actor if the actor is asleep and the commands signal an intent to change the state of the vehicle.

Note

If the steering has changed, the actor will be woken up.

Note

On exit from PxVehiclePhysxActorWakeup, physxSteerState.previousSteerCommand is assigned to the value of commands.steer so that the steer state may be propagated to the subsequent call to PxVehiclePhysxActorWakeup().

Note

If physxSteerState.previousSteerCommand has value PX_VEHICLE_UNSPECIFIED_STEER_STATE, the steering state is treated as though it has not changed.

Parameters
  • commands[in] are the brake, throttle and steer values that will drive the vehicle.

  • transmissionCommands[in] are the target gear and clutch values that will control the transmission. If the target gear is different from the current gearbox target gear, then the physx actor will get woken up. Can be set to NULL if the vehicle does not have a gearbox or if this is not a desired behavior. If specified, then gearParams and gearState has to be specifed too.

  • gearParams[in] The gearbox parameters. Can be set to NULL if the vehicle does not have a gearbox and transmissionCommands is NULL.

  • gearState[in] The state of the gearbox. Can be set to NULL if the vehicle does not have a gearbox and transmissionCommands is NULL.

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

  • physxSteerState[inout] and commands are compared to determine if the steering state has changed since the last call to PxVehiclePhysxActorWakeup().