PxVehiclePhysXActorBeginComponent

Defined in include/vehicle2/physxActor/PxVehiclePhysXActorComponents.h

Inheritance Relationships

Base Type

class PxVehiclePhysXActorBeginComponent : public PxVehicleComponent

Work items at the beginning of an update step for a PhysX actor based vehicle.

Includes:

  • Waking the actor up if it is sleeping and a throttle or steer command is issued.

  • Clearing certain states if the actor is sleeping.

  • Reading the state from the PhysX actor and copy to the vehicle internal state.

Public Functions

inline PxVehiclePhysXActorBeginComponent()
inline virtual ~PxVehiclePhysXActorBeginComponent()
virtual void getDataForPhysXActorBeginComponent(const PxVehicleAxleDescription *&axleDescription, const PxVehicleCommandState *&commands, const PxVehicleEngineDriveTransmissionCommandState *&transmissionCommands, const PxVehicleGearboxParams *&gearParams, const PxVehicleGearboxState *&gearState, const PxVehicleEngineParams *&engineParams, PxVehiclePhysXActor *&physxActor, PxVehiclePhysXSteerState *&physxSteerState, PxVehiclePhysXConstraints *&physxConstraints, PxVehicleRigidBodyState *&rigidBodyState, PxVehicleArrayData<PxVehicleWheelRigidBody1dState> &wheelRigidBody1dStates, PxVehicleEngineState *&engineState) = 0

Provide vehicle data items for this component.

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

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

  • transmissionCommands[out] are the target gear and clutch values that will control the transmission. Can be set to NULL if the vehicle does not have a gearbox. If specified, then gearParams and gearState has to be specifed too.

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

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

  • engineParams[out] The engine parameters. Can be set to NULL if the vehicle does not have an engine. Must be specified, if engineState is specified.

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

  • physxSteerState[out] is the previous state of the steer and is used to determine if the steering wheel has changed by comparing with PxVehicleCommandState::steer.

  • physxConstraints[out] The state of the suspension limit and low speed tire constraints. If the vehicle actor is sleeping and constraints are active, they will be deactivated and marked as dirty.

  • rigidBodyState[out] is the state of the rigid body used by the Vehicle SDK.

  • wheelRigidBody1dStates[out] describes the angular speed of each wheel.

  • engineState[out] The engine state. Can be set to NULL if the vehicle does not have an engine. If specified, then engineParams has to be specifed too.

inline virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)

Update function for a vehicle component.

Parameters
  • dt[in] The timestep size to use for the update step.

  • context[in] Vehicle simulation context holding global data or data that usually applies to a large group of vehicles.

Returns

True if subsequent components in a sequence should get updated, false if the sequence should be aborted.