32#include "vehicle2/PxVehicleAPI.h"
33#include "../base/Base.h"
35namespace snippetvehicle2
39using namespace physx::vehicle2;
47 PxVec3 physxActorBoxShapeHalfExtents;
49 PxTransform physxWheelShapeLocalPoses[PxVehicleLimits::eMAX_NB_WHEELS];
56 const PxVec3& physXActorBoxShapeHalfExtents,
const PxTransform& physxActorBoxShapeLocalPose);
63 if (!physxRoadGeometryQueryParams.isValid())
65 for (PxU32 i = 0; i < axleDesc.
nbWheels; i++)
68 if (!physxMaterialFrictionParams[wheelId].isValid())
70 if (!physxSuspensionLimitConstraintParams[wheelId].isValid())
85 physxActor.setToDefault();
86 physxSteerState.setToDefault();
87 physxConstraints.setToDefault();
119 virtual void destroy();
137 axleDescription = &mBaseParams.axleDescription;
138 commands = &mCommandState;
139 physxActor = &mPhysXState.physxActor;
140 physxSteerState = &mPhysXState.physxSteerState;
141 physxConstraints = &mPhysXState.physxConstraints;
142 rigidBodyState = &mBaseState.rigidBodyState;
143 wheelRigidBody1dStates.
setData(mBaseState.wheelRigidBody1dStates);
145 transmissionCommands = NULL;
162 axleDescription = &mBaseParams.axleDescription;
163 rigidBodyState = &mBaseState.rigidBodyState;
164 wheelParams.
setData(mBaseParams.wheelParams);
165 wheelShapeLocalPoses.
setData(mPhysXParams.physxWheelShapeLocalPoses);
166 wheelRigidBody1dStates.
setData(mBaseState.wheelRigidBody1dStates);
167 wheelLocalPoses.
setData(mBaseState.wheelLocalPoses);
168 physxActor = &mPhysXState.physxActor;
173 virtual void getDataForPhysXConstraintComponent(
185 axleDescription = &mBaseParams.axleDescription;
186 rigidBodyState = &mBaseState.rigidBodyState;
187 suspensionParams.
setData(mBaseParams.suspensionParams);
188 suspensionLimitParams.
setData(mPhysXParams.physxSuspensionLimitConstraintParams);
189 suspensionStates.
setData(mBaseState.suspensionStates);
190 suspensionComplianceStates.
setData(mBaseState.suspensionComplianceStates);
191 wheelRoadGeomStates.
setData(mBaseState.roadGeomStates);
192 tireDirectionStates.
setData(mBaseState.tireDirectionStates);
193 tireStickyStates.
setData(mBaseState.tireStickyStates);
194 constraints = &mPhysXState.physxConstraints;
208 axleDescription = &mBaseParams.axleDescription;
209 roadGeomParams = &mPhysXParams.physxRoadGeometryQueryParams;
210 steerResponseStates.
setData(mBaseState.steerCommandResponseStates);
211 rigidBodyState = &mBaseState.rigidBodyState;
212 wheelParams.
setData(mBaseParams.wheelParams);
213 suspensionParams.
setData(mBaseParams.suspensionParams);
214 materialFrictionParams.
setData(mPhysXParams.physxMaterialFrictionParams);
215 roadGeometryStates.
setData(mBaseState.roadGeomStates);
Material class to represent a set of surface properties.
Definition PxMaterial.h:149
Abstract singleton factory class used for instancing objects in the Physics SDK.
Definition PxPhysics.h:91
Scene query filtering callbacks.
Definition PxQueryFiltering.h:175
A scene is a collection of bodies and constraints which can interact.
Definition PxScene.h:178
3 Element vector class.
Definition PxVec3.h:50
Work items at the beginning of an update step for a PhysX actor based vehicle.
Definition PxVehiclePhysXActorComponents.h:62
Work items at the end of an update step for a PhysX actor based vehicle.
Definition PxVehiclePhysXActorComponents.h:158
Definition PxVehiclePhysXConstraintComponents.h:57
Definition PxVehiclePhysXRoadGeometryComponents.h:56
Definition PhysXIntegration.h:116
virtual void getDataForPhysXRoadGeometrySceneQueryComponent(const PxVehicleAxleDescription *&axleDescription, const PxVehiclePhysXRoadGeometryQueryParams *&roadGeomParams, PxVehicleArrayData< const PxReal > &steerResponseStates, const PxVehicleRigidBodyState *&rigidBodyState, PxVehicleArrayData< const PxVehicleWheelParams > &wheelParams, PxVehicleArrayData< const PxVehicleSuspensionParams > &suspensionParams, PxVehicleArrayData< const PxVehiclePhysXMaterialFrictionParams > &materialFrictionParams, PxVehicleArrayData< PxVehicleRoadGeometryState > &roadGeometryStates, PxVehicleArrayData< PxVehiclePhysXRoadGeometryQueryState > &physxRoadGeometryStates)
Provide vehicle data items for this component.
Definition PhysXIntegration.h:197
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)
Provide vehicle data items for this component.
Definition PhysXIntegration.h:123
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)
Provide vehicle data items for this component.
Definition PhysXIntegration.h:152
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Structure describing parameters affecting mesh cooking.
Definition PxCooking.h:185
Scene query filtering data.
Definition PxQueryFiltering.h:138
Helper struct to pass array type data to vehice components and functions.
Definition PxVehicleParams.h:249
PX_FORCE_INLINE void setEmpty()
Set as empty.
Definition PxVehicleParams.h:333
PX_FORCE_INLINE void setData(T *data)
Set the data as an array of structs.
Definition PxVehicleParams.h:261
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 PxVehicleParams.h:174
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
A mapping between constraint state data and the associated PxConstraint instances.
Definition PxVehiclePhysXConstraintStates.h:317
A mappping between PxMaterial instance and friction for multiple PxMaterial intances.
Definition PxVehiclePhysXRoadGeometryParams.h:142
Definition PxVehiclePhysXRoadGeometryParams.h:115
A description of type of PhysX scene query and the filter data to apply to the query.
Definition PxVehiclePhysXRoadGeometryParams.h:70
A description of the previous steer command applied to the vehicle.
Definition PxVehiclePhysXActorStates.h:80
A description of the PhysX models employed to resolve suspension limit constraints.
Definition PxVehiclePhysXConstraintParams.h:52
Definition PxVehicleRigidBodyStates.h:47
Definition PxVehicleParams.h:224
Definition PhysXIntegration.h:42
Definition PhysXIntegration.h:78