34#include "vehicle2/PxVehicleParams.h"
35#include "vehicle2/PxVehicleComponent.h"
37#include "vehicle2/wheel/PxVehicleWheelStates.h"
39#include "PxVehiclePhysXActorFunctions.h"
40#include "PxVehiclePhysXActorStates.h"
42#include "common/PxProfileZone.h"
112 PX_PROFILE_ZONE(
"PxVehiclePhysXActorBeginComponent::update", 0);
128 gearParams, gearState, engineParams,
129 physxActor, physxSteerState, physxConstraints,
130 rigidBodyState, wheelRigidBody1dStates, engineState);
134 PxVehiclePhysxActorWakeup(*commands, transmissionCommands, gearParams, gearState,
135 *physxActor->
rigidBody, *physxSteerState);
137 if (PxVehiclePhysxActorSleepCheck(*axleDescription, *physxActor->
rigidBody, engineParams,
138 *rigidBodyState, *physxConstraints, wheelRigidBody1dStates, engineState))
144 PxVehicleReadRigidBodyStateFromPhysXActor(*physxActor->
rigidBody, *rigidBodyState);
191 PX_PROFILE_ZONE(
"PxVehiclePhysXActorEndComponent::update", 0);
203 wheelParams, wheelShapeLocalPoses, wheelRigidBody1dStates, wheelLocalPoses, gearState,
206 for (PxU32 i = 0; i < axleDescription->
nbWheels; i++)
210 PxVehicleWriteWheelLocalPoseToPhysXWheelShape(wheelLocalPoses[wheelId].localPose, wheelShapeLocalPoses[wheelId],
218 PxVehicleWriteRigidBodyStateToPhysXActor(physxContext.physxActorUpdateMode, *rigidBodyState, dt, *physxActor->
rigidBody);
220 PxVehiclePhysxActorKeepAwakeCheck(*axleDescription, wheelParams, wheelRigidBody1dStates,
virtual PxScene * getScene() const =0
Retrieves the scene which this actor belongs to.
Definition PxVehicleComponent.h:45
Work items at the beginning of an update step for a PhysX actor based vehicle.
Definition PxVehiclePhysXActorComponents.h:62
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehiclePhysXActorComponents.h:107
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.
Work items at the end of an update step for a PhysX actor based vehicle.
Definition PxVehiclePhysXActorComponents.h:158
virtual void getDataForPhysXActorEndComponent(const PxVehicleAxleDescription *&axleDescription, const PxVehicleRigidBodyState *&rigidBodyState, PxVehicleArrayData< const PxVehicleWheelParams > &wheelParams, PxVehicleArrayData< const PxTransform > &wheelShapeLocalPoses, PxVehicleArrayData< const PxVehicleWheelRigidBody1dState > &wheelRigidBody1dStates, PxVehicleArrayData< const PxVehicleWheelLocalPose > &wheelLocalPoses, const PxVehicleGearboxState *&gearState, PxVehiclePhysXActor *&physxActor)=0
Provide vehicle data items for this component.
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehiclePhysXActorComponents.h:187
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Helper struct to pass array type data to vehice components and functions.
Definition PxVehicleParams.h:249
Definition PxVehicleParams.h:53
PxU32 wheelIdsInAxleOrder[PxVehicleLimits::eMAX_NB_WHEELS]
The list of all wheel ids on the vehicle.
Definition PxVehicleParams.h:149
PxU32 nbWheels
The number of wheels on the vehicle.
Definition PxVehicleParams.h:150
A description of the state of commands that are applied to the vehicle.
Definition PxVehicleCommandStates.h:53
A description of the state of transmission-related commands that are applied to a vehicle with engine...
Definition PxVehicleCommandStates.h:92
Definition PxVehicleDrivetrainParams.h:192
Definition PxVehicleDrivetrainStates.h:67
Definition PxVehicleDrivetrainParams.h:320
Definition PxVehicleDrivetrainStates.h:85
A description of the PhysX actor and shapes that represent the vehicle in an associated PxScene.
Definition PxVehiclePhysXActorStates.h:55
PxShape * wheelShapes[PxVehicleLimits::eMAX_NB_WHEELS]
An array of shapes with one shape pointer (or NULL) for each wheel.
Definition PxVehiclePhysXActorStates.h:65
PxRigidBody * rigidBody
The PhysX rigid body that represents the vehcle in the associated PhysX scene.
Definition PxVehiclePhysXActorStates.h:60
A mapping between constraint state data and the associated PxConstraint instances.
Definition PxVehiclePhysXConstraintStates.h:317
Definition PxVehicleParams.h:742
PxReal physxActorWakeCounterThreshold
Threshold below which to check whether the physx actor wake counter should get reset.
Definition PxVehicleParams.h:778
PxReal physxActorWakeCounterResetValue
Wake counter value to set on the physx actor if a reset is required.
Definition PxVehicleParams.h:768
A description of the previous steer command applied to the vehicle.
Definition PxVehiclePhysXActorStates.h:80
Definition PxVehicleRigidBodyStates.h:47
@ ePHYSX
The simulation context inherits from PxVehiclePhysXSimulationContext.
Definition PxVehicleParams.h:633
Definition PxVehicleParams.h:672