35#include "vehicle2/PxVehicleParams.h"
36#include "vehicle2/PxVehicleComponent.h"
38#include "vehicle2/commands/PxVehicleCommandStates.h"
39#include "vehicle2/commands/PxVehicleCommandHelpers.h"
40#include "vehicle2/rigidBody/PxVehicleRigidBodyParams.h"
41#include "vehicle2/roadGeometry/PxVehicleRoadGeometryState.h"
42#include "vehicle2/wheel/PxVehicleWheelParams.h"
44#include "PxVehicleSuspensionParams.h"
45#include "PxVehicleSuspensionStates.h"
46#include "PxVehicleSuspensionFunctions.h"
48#include "common/PxProfileZone.h"
126 PX_PROFILE_ZONE(
"PxVehicleSuspensionComponent::update", 0);
145 steerResponseStates, rigidBodyState,
146 wheelParams, suspensionParams,
147 suspensionComplianceParams, suspensionForceParams, antiRollForceParams,
148 wheelRoadGeomStates, suspensionStates, suspensionComplianceStates,
149 suspensionForces, antiRollTorque);
151 for (PxU32 i = 0; i < axleDescription->
nbWheels; i++)
156 PxVehicleSuspensionStateUpdate(
157 wheelParams[wheelId], suspensionParams[wheelId], *suspensionStateCalculationParams,
158 suspensionForceParams[wheelId].stiffness, suspensionForceParams[wheelId].damping,
159 steerResponseStates[wheelId], wheelRoadGeomStates[wheelId],
162 suspensionStates[wheelId]);
165 PxVehicleSuspensionComplianceUpdate(
166 suspensionParams[wheelId], suspensionComplianceParams[wheelId],
167 suspensionStates[wheelId],
168 suspensionComplianceStates[wheelId]);
171 PxVehicleSuspensionForceUpdate(
172 suspensionParams[wheelId], suspensionForceParams[wheelId],
173 wheelRoadGeomStates[wheelId], suspensionStates[wheelId],
174 suspensionComplianceStates[wheelId], *rigidBodyState,
176 suspensionForces[wheelId]);
179 if (antiRollForceParams.size>0 && antiRollTorque)
181 PxVehicleAntiRollForceUpdate(
182 suspensionParams, antiRollForceParams,
183 suspensionStates.
getConst(), suspensionComplianceStates.
getConst(), *rigidBodyState,
260 PX_PROFILE_ZONE(
"PxVehicleLegacySuspensionComponent::update", 0);
277 getDataForLegacySuspensionComponent(axleDescription, suspensionStateCalculationParams,
278 steerResponseStates, rigidBodyState, wheelParams,
279 suspensionParams, suspensionComplianceParams,
280 suspensionForceParams, antiRollForceParams,
281 wheelRoadGeomStates, suspensionStates, suspensionComplianceStates,
282 suspensionForces, antiRollTorque);
284 for (PxU32 i = 0; i < axleDescription->
nbWheels; i++)
289 PxVehicleSuspensionStateUpdate(
290 wheelParams[wheelId], suspensionParams[wheelId], *suspensionStateCalculationParams,
291 suspensionForceParams[wheelId].stiffness, suspensionForceParams[wheelId].damping,
292 steerResponseStates[wheelId], wheelRoadGeomStates[wheelId], *rigidBodyState,
294 suspensionStates[wheelId]);
297 PxVehicleSuspensionComplianceUpdate(
298 suspensionParams[wheelId], suspensionComplianceParams[wheelId],
299 suspensionStates[wheelId],
300 suspensionComplianceStates[wheelId]);
303 PxVehicleSuspensionLegacyForceUpdate(
304 suspensionParams[wheelId], suspensionForceParams[wheelId],
305 wheelRoadGeomStates[wheelId], suspensionStates[wheelId],
306 suspensionComplianceStates[wheelId], *rigidBodyState,
308 suspensionForces[wheelId]);
311 if (antiRollForceParams.size>0 && antiRollTorque)
313 PxVehicleAntiRollForceUpdate(
314 suspensionParams, antiRollForceParams,
315 suspensionStates.
getConst(), suspensionComplianceStates.
getConst(), *rigidBodyState,
Definition PxVehicleComponent.h:45
Definition PxVehicleSuspensionComponents.h:195
virtual void getDataForLegacySuspensionComponent(const PxVehicleAxleDescription *&axleDescription, const PxVehicleSuspensionStateCalculationParams *&suspensionStateCalculationParams, PxVehicleArrayData< const PxReal > &steerResponseStates, const PxVehicleRigidBodyState *&rigidBodyState, PxVehicleArrayData< const PxVehicleWheelParams > &wheelParams, PxVehicleArrayData< const PxVehicleSuspensionParams > &suspensionParams, PxVehicleArrayData< const PxVehicleSuspensionComplianceParams > &suspensionComplianceParams, PxVehicleArrayData< const PxVehicleSuspensionForceLegacyParams > &suspensionForceParams, PxVehicleSizedArrayData< const PxVehicleAntiRollForceParams > &antiRollForceParams, PxVehicleArrayData< const PxVehicleRoadGeometryState > &wheelRoadGeomStates, PxVehicleArrayData< PxVehicleSuspensionState > &suspensionStates, PxVehicleArrayData< PxVehicleSuspensionComplianceState > &suspensionComplianceStates, PxVehicleArrayData< PxVehicleSuspensionForce > &suspensionForces, PxVehicleAntiRollTorque *&antiRollTorque)=0
Retrieve pointers to the parameter and state data required to compute the suspension state and the fo...
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update the suspension state and suspension compliance state and use those updated states to compute s...
Definition PxVehicleSuspensionComponents.h:258
Definition PxVehicleSuspensionComponents.h:59
virtual void getDataForSuspensionComponent(const PxVehicleAxleDescription *&axleDescription, const PxVehicleRigidBodyParams *&rigidBodyParams, const PxVehicleSuspensionStateCalculationParams *&suspensionStateCalculationParams, PxVehicleArrayData< const PxReal > &steerResponseStates, const PxVehicleRigidBodyState *&rigidBodyState, PxVehicleArrayData< const PxVehicleWheelParams > &wheelParams, PxVehicleArrayData< const PxVehicleSuspensionParams > &suspensionParams, PxVehicleArrayData< const PxVehicleSuspensionComplianceParams > &suspensionComplianceParams, PxVehicleArrayData< const PxVehicleSuspensionForceParams > &suspensionForceParams, PxVehicleSizedArrayData< const PxVehicleAntiRollForceParams > &antiRollForceParams, PxVehicleArrayData< const PxVehicleRoadGeometryState > &wheelRoadGeomStates, PxVehicleArrayData< PxVehicleSuspensionState > &suspensionStates, PxVehicleArrayData< PxVehicleSuspensionComplianceState > &suspensionComplianceStates, PxVehicleArrayData< PxVehicleSuspensionForce > &suspensionForces, PxVehicleAntiRollTorque *&antiRollTorque)=0
Retrieve pointers to the parameter and state data required to compute the suspension state and the fo...
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update the suspension state and suspension compliance state and use those updated states to compute s...
Definition PxVehicleSuspensionComponents.h:124
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
The anti-roll torque of all anti-roll bars accumulates in a single torque to apply to the vehicle's r...
Definition PxVehicleSuspensionStates.h:168
Helper struct to pass array type data to vehice components and functions.
Definition PxVehicleParams.h:249
PX_FORCE_INLINE const PxVehicleArrayData< const T > & getConst() const
Get a reference to the array but read only.
Definition PxVehicleParams.h:353
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
The properties of the rigid body.
Definition PxVehicleRigidBodyParams.h:50
PxReal mass
The mass of the rigid body.
Definition PxVehicleRigidBodyParams.h:57
Definition PxVehicleRigidBodyStates.h:47
Definition PxVehicleParams.h:672
Definition PxVehicleParams.h:369
Definition PxVehicleSuspensionParams.h:113