35#include "foundation/PxTransform.h"
36#include "foundation/PxFoundation.h"
38#include "common/PxCoreUtilityTypes.h"
40#include "vehicle2/PxVehicleParams.h"
41#include "vehicle2/PxVehicleFunctions.h"
93 PX_CHECK_AND_RETURN_VAL(
suspensionAttachment.
isValid(),
"PxVehicleSuspensionParams.suspensionAttachment must be a valid transform",
false);
94 PX_CHECK_AND_RETURN_VAL(
suspensionTravelDir.
isFinite(),
"PxVehicleSuspensionParams.suspensionTravelDir must be a valid vector",
false);
96 PX_CHECK_AND_RETURN_VAL(
suspensionTravelDist > 0.0f,
"PxVehicleSuspensionParams.suspensionTravelDist must be greater than zero",
false);
97 PX_CHECK_AND_RETURN_VAL(
wheelAttachment.
isValid(),
"PxVehicleSuspensionParams.wheelAttachment must be a valid transform",
false);
187 const PxReal scale = trgScale.
scale / srcScale.
scale;
203 PX_CHECK_AND_RETURN_VAL(
wheelToeAngle.isValid(),
"PxVehicleSuspensionComplianceParams.wheelToeAngle is invalid",
false);
204 PX_CHECK_AND_RETURN_VAL(
wheelCamberAngle.isValid(),
"PxVehicleSuspensionComplianceParams.wheelCamberAngle is invalid",
false);
205 PX_CHECK_AND_RETURN_VAL(
suspForceAppPoint.isValid(),
"PxVehicleSuspensionComplianceParams.wheelToeAngle is invalid",
false);
206 PX_CHECK_AND_RETURN_VAL(
tireForceAppPoint.isValid(),
"PxVehicleSuspensionComplianceParams.wheelCamberAngle is invalid",
false);
210 PX_CHECK_AND_RETURN_VAL(
wheelToeAngle.xVals[i] >= 0.0f &&
wheelToeAngle.xVals[i] <= 1.0f,
"PxVehicleSuspensionComplianceParams.wheelToeAngle must be an array of points (x,y) with x in range [0, 1]",
false);
211 PX_CHECK_AND_RETURN_VAL(
wheelToeAngle.yVals[i] >= -PxPi &&
wheelToeAngle.yVals[i] <= PxPi,
"PxVehicleSuspensionComplianceParams.wheelToeAngle must be an array of points (x,y) with y in range [-Pi, Pi]",
false);
215 PX_CHECK_AND_RETURN_VAL(
wheelCamberAngle.xVals[i] >= 0.0f &&
wheelCamberAngle.xVals[i] <= 1.0f,
"PxVehicleSuspensionComplianceParams.wheelCamberAngle must be an array of points (x,y) with x in range [0, 1]",
false);
216 PX_CHECK_AND_RETURN_VAL(
wheelCamberAngle.yVals[i] >= -PxPi &&
wheelCamberAngle.yVals[i] <= PxPi,
"PxVehicleSuspensionComplianceParams.wheelCamberAngle must be an array of points (x,y) with y in range [-Pi, Pi]",
false);
221 PX_CHECK_AND_RETURN_VAL(
suspForceAppPoint.xVals[i] >= 0.0f &&
suspForceAppPoint.xVals[i] <= 1.0f,
"PxVehicleSuspensionComplianceParams.suspForceAppPoint[0] must be an array of points (x,y) with x in range [0, 1]",
false);
225 PX_CHECK_AND_RETURN_VAL(
tireForceAppPoint.xVals[i] >= 0.0f &&
tireForceAppPoint.xVals[i] <= 1.0f,
"PxVehicleSuspensionComplianceParams.tireForceAppPoint[0] must be an array of points (x,y) with x in range [0, 1]",
false);
273 PX_CHECK_AND_RETURN_VAL(
stiffness > 0.0f,
"PxVehicleSuspensionForceParams.stiffness must be greater than zero",
false);
274 PX_CHECK_AND_RETURN_VAL(
damping >= 0.0f,
"PxVehicleSuspensionForceParams.damping must be greater than or equal to zero",
false);
275 PX_CHECK_AND_RETURN_VAL(
sprungMass > 0.0f,
"PxVehicleSuspensionForceParams.sprungMass must be greater than zero",
false);
331 PX_CHECK_AND_RETURN_VAL(stiffness > 0.0f,
"PxVehicleSuspensionForceLegacyParams.stiffness must be greater than zero",
false);
332 PX_CHECK_AND_RETURN_VAL(damping >= 0.0f,
"PxVehicleSuspensionForceLegacyParams.damping must be greater than or equal to zero",
false);
333 PX_CHECK_AND_RETURN_VAL(restDistance > 0.0f,
"PxVehicleSuspensionForceLegacyParams.restDistance must be greater than zero",
false);
334 PX_CHECK_AND_RETURN_VAL(sprungMass > 0.0f,
"PxVehicleSuspensionForceLegacyParams.sprungMass must be greater than zero",
false);
383 if (wheel0 == wheel1)
387 const PxU32 wheelIds[2] = { wheel0, wheel1 };
388 for (PxU32 k = 0; k < 2; k++)
390 const PxU32 wheelToFind = wheelIds[k];
391 bool foundWheelInAxleDescription =
false;
392 for (PxU32 i = 0; i < axleDesc.
nbWheels; i++)
395 if (wheel == wheelToFind)
397 foundWheelInAxleDescription =
true;
400 if (!foundWheelInAxleDescription)
3 Element vector class.
Definition PxVec3.h:50
PX_CUDA_CALLABLE PX_INLINE bool isFinite() const
returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
Definition PxVec3.h:156
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isNormalized() const
is normalized - used by API parameter validation
Definition PxVec3.h:164
Express a function as a sequence of points {(x, y)} that form a piecewise polynomial.
Definition PxVehicleParams.h:808
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#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
PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxIsFinite(float f)
returns true if the passed number is a finite floating point number as opposed to INF,...
Definition PxMath.h:326
The purpose of the anti-roll bar is to generate a torque to apply to the vehicle's rigid body that wi...
Definition PxVehicleSuspensionParams.h:347
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
Definition PxVehicleParams.h:174
Definition PxVehicleParams.h:224
PxReal scale
The length scale used for the vehicle. For example, if 1.0 is considered meters, then 100....
Definition PxVehicleParams.h:225
Compliance describes how toe and camber angle and force application points are affected by suspension...
Definition PxVehicleSuspensionParams.h:155
PxVehicleFixedSizeLookupTable< PxVec3, 3 > suspForceAppPoint
Suspension forces are applied at an offset from the suspension frame. suspForceAppPoint specifies the...
Definition PxVehicleSuspensionParams.h:172
PxVehicleFixedSizeLookupTable< PxVec3, 3 > tireForceAppPoint
Tire forces are applied at an offset from the suspension frame. tireForceAppPoint specifies the (X,...
Definition PxVehicleSuspensionParams.h:178
PxVehicleFixedSizeLookupTable< PxReal, 3 > wheelCamberAngle
A graph of camber angle against jounce/suspensionTravelDist with the camber angle expressed in radian...
Definition PxVehicleSuspensionParams.h:166
PxVehicleFixedSizeLookupTable< PxReal, 3 > wheelToeAngle
A graph of toe angle against jounce/suspensionTravelDist with the toe angle expressed in radians.
Definition PxVehicleSuspensionParams.h:160
Suspension force is computed by converting suspenson state to suspension force under the assumption o...
Definition PxVehicleSuspensionParams.h:286
PxReal sprungMass
The mass supported by the suspension spring.
Definition PxVehicleSuspensionParams.h:317
PxReal stiffness
Spring strength of suspension.
Definition PxVehicleSuspensionParams.h:293
PxReal restDistance
The suspension compression that balances the gravitational force acting on the sprung mass.
Definition PxVehicleSuspensionParams.h:309
PxReal damping
Spring damper rate of suspension.
Definition PxVehicleSuspensionParams.h:301
Suspension force is computed by converting suspenson state to suspension force under the assumption o...
Definition PxVehicleSuspensionParams.h:236
PxReal stiffness
Spring strength of suspension.
Definition PxVehicleSuspensionParams.h:243
PxReal damping
Spring damper rate of suspension.
Definition PxVehicleSuspensionParams.h:251
PxReal sprungMass
Part of the vehicle mass that is supported by the suspension spring.
Definition PxVehicleSuspensionParams.h:259
Definition PxVehicleSuspensionParams.h:103
Enum
Definition PxVehicleSuspensionParams.h:105
@ eRAYCAST
The jounce is calculated using a raycast against the plane of the road geometry state.
Definition PxVehicleSuspensionParams.h:106
@ eSWEEP
The jounce is calculated by sweeping a cylinder against the plane of the road geometry state.
Definition PxVehicleSuspensionParams.h:107
Definition PxVehicleSuspensionParams.h:51
PxVec3 suspensionTravelDir
suspensionTravelDir specifies the direction of suspension travel.
Definition PxVehicleSuspensionParams.h:63
PxTransform wheelAttachment
wheelAttachment is the pose of the wheel in the suspension frame.
Definition PxVehicleSuspensionParams.h:77
PxReal suspensionTravelDist
suspensionTravelDist is the maximum distance that the suspenson can elongate along suspensionTravelDi...
Definition PxVehicleSuspensionParams.h:71
PxTransform suspensionAttachment
suspensionAttachment specifies the wheel pose at maximum compression.
Definition PxVehicleSuspensionParams.h:57
Definition PxVehicleSuspensionParams.h:113
bool limitSuspensionExpansionVelocity
Limit the suspension expansion dynamics.
Definition PxVehicleSuspensionParams.h:127