29#ifndef PX_VEHICLE_SUSP_WHEEL_TIRE4_H
30#define PX_VEHICLE_SUSP_WHEEL_TIRE4_H
35#include "foundation/PxSimpleTypes.h"
36#include "foundation/PxVec3.h"
37#include "foundation/PxVec4.h"
38#include "foundation/PxTransform.h"
39#include "foundation/PxIO.h"
40#include "geometry/PxGeometryHelpers.h"
41#include "vehicle/PxVehicleComponents.h"
42#include "PxVehicleSuspLimitConstraintShader.h"
43#include "extensions/PxSceneQueryExt.h"
67 bool isValid(
const PxU32
id)
const;
76 PX_FORCE_INLINE const PxVec3& getSuspTravelDirection(
const PxU32
id)
const {
return mSuspDownwardTravelDirections[id];}
77 PX_FORCE_INLINE const PxVec3& getSuspForceAppPointOffset(
const PxU32
id)
const {
return mSuspForceAppPointOffsets[id];}
78 PX_FORCE_INLINE const PxVec3& getTireForceAppPointOffset(
const PxU32
id)
const {
return mTireForceAppPointOffsets[id];}
79 PX_FORCE_INLINE const PxVec3& getWheelCentreOffset(
const PxU32
id)
const {
return mWheelCentreOffsets[id];}
80 PX_FORCE_INLINE PxI32 getWheelShapeMapping(
const PxU32
id)
const {
return (PX_MAX_U8 != mWheelShapeMap[
id]) ? mWheelShapeMap[id] : -1;}
82 PX_FORCE_INLINE const PxReal* getTireRestLoadsArray()
const {
return mTireRestLoads;}
83 PX_FORCE_INLINE const PxReal* getRecipTireRestLoadsArray()
const {
return mRecipTireRestLoads;}
88 void setSuspTravelDirection (
const PxU32
id,
const PxVec3& dir);
89 void setSuspForceAppPointOffset (
const PxU32
id,
const PxVec3& offset);
90 void setTireForceAppPointOffset (
const PxU32
id,
const PxVec3& offset);
91 void setWheelCentreOffset (
const PxU32
id,
const PxVec3& offset);
92 void setWheelShapeMapping (
const PxU32
id,
const PxI32 shapeId);
93 void setSceneQueryFilterData (
const PxU32
id,
const PxFilterData& sqFilterData);
118 PxVec3 mSuspDownwardTravelDirections[4];
123 PxVec3 mSuspForceAppPointOffsets[4];
128 PxVec3 mTireForceAppPointOffsets[4];
133 PxVec3 mWheelCentreOffsets[4];
138 PxReal mTireRestLoads[4];
143 PxReal mRecipTireRestLoads[4];
160 PxU8 mWheelShapeMap[4];
188 bool isValid()
const {
return true;}
192 void setToRestState()
194 for(PxU32 i=0;i<4;i++)
203 mVehicleConstraints->mData.mStickyTireForwardData.mActiveFlags[i] =
false;
204 mVehicleConstraints->mData.mStickyTireSideData.mActiveFlags[i] =
false;
205 mVehicleConstraints->mData.mSuspLimitData.mActiveFlags[i] =
false;
214 void setInternalDynamicsToZero()
216 for(PxU32 i=0;i<4;i++)
225 void setTireContacts(
const PxU32* cachedHitCounts,
const PxPlane* cachedHitPlanes,
const PxF32* cachedFrictionMultipliers,
const PxTireContactIntersectionMethod::Enum* cachedQueryTypes)
234 for (PxU32 i = 0; i < 4; i++)
236 cachedRaycastHitResults->
mCounts[i] = PxU16(cachedHitCounts[i]);
237 cachedRaycastHitResults->
mPlanes[i] = cachedHitPlanes[i];
238 cachedRaycastHitResults->
mDistances[i] = 1.0f;
240 cachedRaycastHitResults->
mQueryTypes[i] = ((cachedQueryTypes[i] == PxTireContactIntersectionMethod::eRAY) ? 0 : 1);
382 PxVehicleConstraintShader* mVehicleConstraints;
Geometry holder class.
Definition PxGeometryHelpers.h:66
Output stream class for I/O.
Definition PxIO.h:114
Representation of a plane.
Definition PxPlane.h:49
3 Element vector class.
Definition PxVec3.h:50
Definition PxVehicleSuspLimitConstraintShader.h:47
Definition PxVehicleComponents.h:957
Definition PxVehicleComponents.h:1176
Definition PxVehicleUpdate.cpp:4519
Definition PxVehicleComponents.h:815
Definition PxVehicleSuspWheelTire4.h:167
PxReal mWheelRotationAngles[4]
Reported rotation angle about rolling axis.
Definition PxVehicleSuspWheelTire4.h:259
PxReal mSteerAngles[4]
Previous steer angle.
Definition PxVehicleSuspWheelTire4.h:283
PxReal mWheelSpeeds[4]
Rotation speeds of wheels.
Definition PxVehicleSuspWheelTire4.h:248
const PxSweepBuffer * mSweepResults
Set by PxVehicleSuspensionSweeps.
Definition PxVehicleSuspWheelTire4.h:396
const PxRaycastBuffer * mRaycastResults
Set by PxVehicleSuspensionRaycasts.
Definition PxVehicleSuspWheelTire4.h:390
void setVehicleConstraintShader(PxVehicleConstraintShader *shader)
Used only internally.
Definition PxVehicleSuspWheelTire4.h:376
PxU8 mQueryOrCachedHitResults[sizeof(SuspLineSweep)]
We either have a fresh raycast that was just performed or a cached raycast result that will be used i...
Definition PxVehicleSuspWheelTire4.h:371
PxReal mTireLowForwardSpeedTimers[4]
Timers used to trigger sticky friction to hold the car perfectly at rest.
Definition PxVehicleSuspWheelTire4.h:265
PxReal mCorrectedWheelSpeeds[4]
Rotation speeds of wheels used to update the wheel rotation angles.
Definition PxVehicleSuspWheelTire4.h:253
PxReal mJounces[4]
Previous suspension jounce.
Definition PxVehicleSuspWheelTire4.h:277
PxReal mTireLowSideSpeedTimers[4]
Timers used to trigger sticky friction to hold the car perfectly at rest.
Definition PxVehicleSuspWheelTire4.h:271
bool mHasCachedRaycastHitPlane
Set true if a raycast hit plane has been recorded and cached. This requires a raycast to be performed...
Definition PxVehicleSuspWheelTire4.h:403
Definition PxVehicleSuspWheelTire4.h:54
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_FORCE_INLINE void * PxMemZero(void *dest, PxU32 count)
Sets the bytes of the provided buffer to zero.
Definition PxMemory.h:53
PxFilterData is user-definable data which gets passed into the collision filtering shader and/or call...
Definition PxFiltering.h:365
Definition PxVehicleSuspWheelTire4.h:336
PxU16 mCounts[4]
Cached raycast hit counts. These are the hit counts found from the last scene queries.
Definition PxVehicleSuspWheelTire4.h:358
PxF32 mDistances[4]
Cached raycast hit distance. These are the hit distances found from the last scene queries.
Definition PxVehicleSuspWheelTire4.h:352
PxU16 mQueryTypes[4]
Store 0 if cached results are from raycasts, store 1 if cached results are from sweeps.
Definition PxVehicleSuspWheelTire4.h:363
PxPlane mPlanes[4]
Cached raycast hit planes. These are the planes found from the last scene queries.
Definition PxVehicleSuspWheelTire4.h:341
PxF32 mFrictionMultipliers[4]
Cached friction.
Definition PxVehicleSuspWheelTire4.h:347
Definition PxVehicleSuspWheelTire4.h:313
PxVec3 mDirs[4]
Directions of suspension line raycasts used in most recent scene query.
Definition PxVehicleSuspWheelTire4.h:324
PxReal mLengths[4]
Lengths of suspension line raycasts used in most recent scene query.
Definition PxVehicleSuspWheelTire4.h:330
PxVec3 mStarts[4]
Start point of suspension line raycasts used in most recent scene query.
Definition PxVehicleSuspWheelTire4.h:318
Definition PxVehicleSuspWheelTire4.h:286
PxTransform mStartPose[4]
Start poses of suspension line sweep used in most recent scene query.
Definition PxVehicleSuspWheelTire4.h:297
PxVec3 mDirs[4]
Directions of suspension line sweeps used in most recent scene query.
Definition PxVehicleSuspWheelTire4.h:303
PxReal mLengths[4]
Lengths of suspension line sweeps used in most recent scene query.
Definition PxVehicleSuspWheelTire4.h:309
PxGeometryHolder mGometries[4]
Geometry suspension line sweep used in most recent scene query.
Definition PxVehicleSuspWheelTire4.h:291