RavEngine
Loading...
Searching...
No Matches
physx::vehicle2::PxVehiclePhysXActorBeginComponent Class Referenceabstract

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

#include <PxVehiclePhysXActorComponents.h>

Inheritance diagram for physx::vehicle2::PxVehiclePhysXActorBeginComponent:
[legend]
Collaboration diagram for physx::vehicle2::PxVehiclePhysXActorBeginComponent:
[legend]

Public Member Functions

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.
 
virtual bool update (const PxReal dt, const PxVehicleSimulationContext &context)
 Update function for a vehicle component.
 

Detailed Description

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.
See also
PxVehiclePhysxActorWakeup PxVehiclePhysxActorSleepCheck PxVehicleReadRigidBodyStateFromPhysXActor

Member Function Documentation

◆ getDataForPhysXActorBeginComponent()

virtual void physx::vehicle2::PxVehiclePhysXActorBeginComponent::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 
)
pure virtual

Provide vehicle data items for this component.

Parameters
[out]axleDescriptionidentifies the wheels on each axle.
[out]commandsare the brake, throttle and steer values that will drive the vehicle.
[out]transmissionCommandsare 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.
[out]gearParamsThe gearbox parameters. Can be set to NULL if the vehicle does not have a gearbox and transmissionCommands is NULL.
[out]gearStateThe state of the gearbox. Can be set to NULL if the vehicle does not have a gearbox and transmissionCommands is NULL.
[out]engineParamsThe engine parameters. Can be set to NULL if the vehicle does not have an engine. Must be specified, if engineState is specified.
[out]physxActoris the PxRigidBody instance associated with the vehicle.
[out]physxSteerStateis the previous state of the steer and is used to determine if the steering wheel has changed by comparing with PxVehicleCommandState::steer.
[out]physxConstraintsThe 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.
[out]rigidBodyStateis the state of the rigid body used by the Vehicle SDK.
[out]wheelRigidBody1dStatesdescribes the angular speed of each wheel.
[out]engineStateThe engine state. Can be set to NULL if the vehicle does not have an engine. If specified, then engineParams has to be specifed too.

Implemented in snippetvehicle2::EngineDriveVehicle, and snippetvehicle2::PhysXActorVehicle.

◆ update()

virtual bool physx::vehicle2::PxVehiclePhysXActorBeginComponent::update ( const PxReal  dt,
const PxVehicleSimulationContext &  context 
)
inlinevirtual

Update function for a vehicle component.

Parameters
[in]dtThe timestep size to use for the update step.
[in]contextVehicle 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.
See also
PxVehicleComponentSequence

Implements physx::vehicle2::PxVehicleComponent.


The documentation for this class was generated from the following file: