RavEngine
Loading...
Searching...
No Matches
PxVehicleParams.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#pragma once
33#include "foundation/PxFoundation.h"
34#include "foundation/PxAssert.h"
35#include "foundation/PxMemory.h"
36#include "foundation/PxVec3.h"
37#include "foundation/PxMat33.h"
38
39#include "PxVehicleLimits.h"
40
41class OmniPvdWriter;
42
43#if !PX_DOXYGEN
44namespace physx
45{
46class PxConvexMesh;
47class PxScene;
48namespace vehicle2
49{
50#endif
51
53{
54 PX_FORCE_INLINE void setToDefault()
55 {
57 }
58
64 void addAxle(const PxU32 nbWheelsOnAxle, const PxU32* const wheelIdsOnAxle)
65 {
66 PX_ASSERT((nbWheels + nbWheelsOnAxle) < PxVehicleLimits::eMAX_NB_WHEELS);
67 PX_ASSERT(nbAxles < PxVehicleLimits::eMAX_NB_AXLES);
68 nbWheelsPerAxle[nbAxles] = nbWheelsOnAxle;
70 for (PxU32 i = 0; i < nbWheelsOnAxle; i++)
71 {
72 wheelIdsInAxleOrder[nbWheels + i] = wheelIdsOnAxle[i];
73 }
74 nbWheels += nbWheelsOnAxle;
75 nbAxles++;
76 }
77
84 {
85 return nbAxles;
86 }
87
94 PX_FORCE_INLINE PxU32 getNbWheelsOnAxle(const PxU32 i) const
95 {
96 return nbWheelsPerAxle[i];
97 }
98
106 PX_FORCE_INLINE PxU32 getWheelOnAxle(const PxU32 j, const PxU32 i) const
107 {
108 return wheelIdsInAxleOrder[axleToWheelIds[i] + j];
109 }
110
116 {
117 return nbWheels;
118 }
119
125 PX_FORCE_INLINE PxU32 getAxle(const PxU32 wheelId) const
126 {
127 for (PxU32 i = 0; i < getNbAxles(); i++)
128 {
129 for (PxU32 j = 0; j < getNbWheelsOnAxle(i); j++)
130 {
131 if (getWheelOnAxle(j, i) == wheelId)
132 return i;
133 }
134 }
135 return 0xffffffff;
136 }
137
138 PX_FORCE_INLINE bool isValid() const
139 {
140 PX_CHECK_AND_RETURN_VAL(nbAxles > 0, "PxVehicleAxleDescription.nbAxles must be greater than zero", false);
141 PX_CHECK_AND_RETURN_VAL(nbWheels > 0, "PxVehicleAxleDescription.nbWheels must be greater than zero", false);
142 return true;
143 }
144
145 PxU32 nbAxles;
146 PxU32 nbWheelsPerAxle[PxVehicleLimits::eMAX_NB_AXLES];
147 PxU32 axleToWheelIds[PxVehicleLimits::eMAX_NB_AXLES];
148
149 PxU32 wheelIdsInAxleOrder[PxVehicleLimits::eMAX_NB_WHEELS];
150 PxU32 nbWheels;
151
152
153 PX_COMPILE_TIME_ASSERT(PxVehicleLimits::eMAX_NB_AXLES == PxVehicleLimits::eMAX_NB_WHEELS);
154 // It should be possible to support cases where each wheel is controlled individually and thus
155 // having a wheel per axle for up to the max wheel count.
156};
157
158
160{
161 enum Enum
162 {
163 ePosX = 0,
169 eMAX_NB_AXES
170 };
171};
172
174{
178
179 PX_FORCE_INLINE void setToDefault()
180 {
184 }
185
186 PX_FORCE_INLINE PxMat33 getFrame() const
187 {
188 const PxVec3 basisDirs[6] = { PxVec3(1,0,0), PxVec3(-1,0,0), PxVec3(0,1,0), PxVec3(0,-1,0), PxVec3(0,0,1), PxVec3(0,0,-1) };
189 const PxMat33 mat33(basisDirs[lngAxis], basisDirs[latAxis], basisDirs[vrtAxis]);
190 return mat33;
191 }
192
193 PX_FORCE_INLINE PxVec3 getLngAxis() const
194 {
195 const PxVec3 basisDirs[6] = { PxVec3(1,0,0), PxVec3(-1,0,0), PxVec3(0,1,0), PxVec3(0,-1,0), PxVec3(0,0,1), PxVec3(0,0,-1) };
196 return basisDirs[lngAxis];
197 }
198
199 PX_FORCE_INLINE PxVec3 getLatAxis() const
200 {
201 const PxVec3 basisDirs[6] = { PxVec3(1,0,0), PxVec3(-1,0,0), PxVec3(0,1,0), PxVec3(0,-1,0), PxVec3(0,0,1), PxVec3(0,0,-1) };
202 return basisDirs[latAxis];
203 }
204
205 PX_FORCE_INLINE PxVec3 getVrtAxis() const
206 {
207 const PxVec3 basisDirs[6] = { PxVec3(1,0,0), PxVec3(-1,0,0), PxVec3(0,1,0), PxVec3(0,-1,0), PxVec3(0,0,1), PxVec3(0,0,-1) };
208 return basisDirs[vrtAxis];
209 }
210
211 PX_FORCE_INLINE bool isValid() const
212 {
213 PX_CHECK_AND_RETURN_VAL(lngAxis < PxVehicleAxes::eMAX_NB_AXES, "PxVehicleFrame.lngAxis is invalid", false);
214 PX_CHECK_AND_RETURN_VAL(latAxis < PxVehicleAxes::eMAX_NB_AXES, "PxVehicleFrame.latAxis is invalid", false);
215 PX_CHECK_AND_RETURN_VAL(vrtAxis < PxVehicleAxes::eMAX_NB_AXES, "PxVehicleFrame.vrtAxis is invalid", false);
216 const PxMat33 frame = getFrame();
217 const PxQuat quat(frame);
218 PX_CHECK_AND_RETURN_VAL(quat.isFinite() && quat.isUnit() && quat.isSane(), "PxVehicleFrame is not a legal frame", false);
219 return true;
220 }
221};
222
224{
225 PxReal scale;
226
227 PX_FORCE_INLINE void setToDefault()
228 {
229 scale = 1.0f;
230 }
231
232 PX_FORCE_INLINE bool isValid() const
233 {
234 PX_CHECK_AND_RETURN_VAL(scale > 0.0f, "PxVehicleScale.scale must be greater than zero", false);
235 return true;
236 }
237};
238
247template<typename T>
249{
255
262 {
263 arrayOfStructs = data;
264 dataFormat = eARRAY_OF_STRUCTS;
265 }
266
272 PX_FORCE_INLINE void setData(T*const* data)
273 {
274 arrayOfPointers= data;
275 dataFormat = eARRAY_OF_POINTERS;
276 }
277
279 {
280 }
281
282 PX_FORCE_INLINE explicit PxVehicleArrayData(T* data)
283 {
284 setData(data);
285 }
286
287 PX_FORCE_INLINE explicit PxVehicleArrayData(T*const* data)
288 {
289 setData(data);
290 }
291
298 PX_FORCE_INLINE T& getData(PxU32 index)
299 {
300 if (dataFormat == eARRAY_OF_STRUCTS)
301 return arrayOfStructs[index];
302 else
303 return *arrayOfPointers[index];
304 }
305
306 PX_FORCE_INLINE T& operator[](PxU32 index)
307 {
308 return getData(index);
309 }
310
317 PX_FORCE_INLINE const T& getData(PxU32 index) const
318 {
319 if (dataFormat == eARRAY_OF_STRUCTS)
320 return arrayOfStructs[index];
321 else
322 return *arrayOfPointers[index];
323 }
324
325 PX_FORCE_INLINE const T& operator[](PxU32 index) const
326 {
327 return getData(index);
328 }
329
334 {
335 arrayOfStructs = NULL;
336 }
337
344 {
345 return (arrayOfStructs == NULL);
346 }
347
354 {
355 return reinterpret_cast<const PxVehicleArrayData<const T>&>(*this);
356 }
357
358
359 union
360 {
363 };
364 PxU8 dataFormat;
365};
366
367template<typename T>
369{
376 PX_FORCE_INLINE void setDataAndCount(T* data, const PxU32 count)
377 {
379 size = count;
380 }
381
388 PX_FORCE_INLINE void setDataAndCount(T*const* data, const PxU32 count)
389 {
391 size = count;
392 }
393
398 {
400 size = 0;
401 }
402
409 {
410 return ((size == 0) || PxVehicleArrayData<T>::isEmpty());
411 }
412
413 PxU32 size;
414};
415
425{
426 enum Enum
427 {
428 eAPPLY_VELOCITY = 0,
429 eAPPLY_ACCELERATION
430 };
431};
432
438{
450
467
483
484 PX_FORCE_INLINE void setToDefault()
485 {
489 }
490
492 const PxVehicleFrame& srcFrame, const PxVehicleFrame& trgFrame, const PxVehicleScale& srcScale, const PxVehicleScale& trgScale) const
493 {
494 PX_UNUSED(srcFrame);
495 PX_UNUSED(trgFrame);
496 PxVehicleTireSlipParams p = *this;
497 const PxReal scaleRatio = trgScale.scale / srcScale.scale;
498 p.minLatSlipDenominator *= scaleRatio;
499 p.minPassiveLongSlipDenominator *= scaleRatio;
500 p.minActiveLongSlipDenominator *= scaleRatio;
501 return p;
502 }
503
504 PX_FORCE_INLINE bool isValid() const
505 {
506 PX_CHECK_AND_RETURN_VAL(minLatSlipDenominator > 0.0f, "PxVehicleTireSlipParams.minLatSlipDenominator must be greater than zero", false);
507 PX_CHECK_AND_RETURN_VAL(minPassiveLongSlipDenominator > 0.0f, "PxVehicleTireSlipParams.minPassiveLongSlipDenominator must be greater than zero", false);
508 PX_CHECK_AND_RETURN_VAL(minActiveLongSlipDenominator > 0.0f, "PxVehicleTireSlipParams.minActiveLongSlipDenominator must be greater than zero", false);
509 return true;
510 }
511};
512
517{
518 enum Enum
519 {
520 eLONGITUDINAL = 0,
521 eLATERAL,
522 eMAX_NB_PLANAR_DIRECTIONS
523 };
524};
525
535{
544
553
562 PxReal damping;
563
564
566 const PxVehicleFrame& srcFrame, const PxVehicleFrame& trgFrame, const PxVehicleScale& srcScale, const PxVehicleScale& trgScale) const
567 {
568 PX_UNUSED(srcFrame);
569 PX_UNUSED(trgFrame);
571 const PxReal scaleRatio = trgScale.scale / srcScale.scale;
572 p.thresholdSpeed *= scaleRatio;
573 return p;
574 }
575
576 PX_FORCE_INLINE bool isValid() const
577 {
578 PX_CHECK_AND_RETURN_VAL(thresholdSpeed >= 0.0f, "PxVehicleTireAxisStickyParams.thresholdSpeed must be greater than or equal to zero", false);
579 PX_CHECK_AND_RETURN_VAL(thresholdTime >= 0.0f, "PxVehicleTireAxisStickyParams.thresholdTime must be greater than or equal to zero", false);
580 PX_CHECK_AND_RETURN_VAL(damping >= 0.0f, "PxVehicleTireAxisStickyParams.damping must be greater than or equal to zero", false);
581 return true;
582 }
583};
584
590{
595 PxVehicleTireAxisStickyParams stickyParams[PxVehicleTireDirectionModes::eMAX_NB_PLANAR_DIRECTIONS];
596
597 PX_FORCE_INLINE void setToDefault()
598 {
599 stickyParams[PxVehicleTireDirectionModes::eLONGITUDINAL].thresholdSpeed = 0.2f;
600 stickyParams[PxVehicleTireDirectionModes::eLONGITUDINAL].thresholdTime = 1.0f;
601 stickyParams[PxVehicleTireDirectionModes::eLONGITUDINAL].damping = 1.0f;
602 stickyParams[PxVehicleTireDirectionModes::eLATERAL].thresholdSpeed = 0.2f;
603 stickyParams[PxVehicleTireDirectionModes::eLATERAL].thresholdTime = 1.0f;
604 stickyParams[PxVehicleTireDirectionModes::eLATERAL].damping = 0.1f;
605 }
606
608 const PxVehicleFrame& srcFrame, const PxVehicleFrame& trgFrame, const PxVehicleScale& srcScale, const PxVehicleScale& trgScale) const
609 {
611 p.stickyParams[PxVehicleTireDirectionModes::eLONGITUDINAL] =
612 stickyParams[PxVehicleTireDirectionModes::eLONGITUDINAL].transformAndScale(srcFrame, trgFrame, srcScale, trgScale);
613 p.stickyParams[PxVehicleTireDirectionModes::eLATERAL] =
614 stickyParams[PxVehicleTireDirectionModes::eLATERAL].transformAndScale(srcFrame, trgFrame, srcScale, trgScale);
615 return p;
616 }
617
618 PX_FORCE_INLINE bool isValid() const
619 {
620 if (!stickyParams[PxVehicleTireDirectionModes::eLONGITUDINAL].isValid())
621 return false;
622 if (!stickyParams[PxVehicleTireDirectionModes::eLATERAL].isValid())
623 return false;
624 return true;
625 }
626};
627
636
641{
642public:
643 PX_FORCE_INLINE void setToDefault()
644 {
645 attributeHandles = NULL;
646 writer = NULL;
647 }
648
649
659
669};
670
672{
675 {}
676
677 PxVec3 gravity;
678
679 PxVehicleFrame frame;
680 PxVehicleScale scale;
681
682 //Tire
683 PxVehicleTireSlipParams tireSlipParams;
684 PxVehicleTireStickyParams tireStickyParams;
685
697
702
703protected:
705
706
707public:
708 PX_FORCE_INLINE PxVehicleSimulationContextType::Enum getType() const { return type; }
709
710 PX_FORCE_INLINE void setToDefault()
711 {
712 frame.setToDefault();
713 scale.setToDefault();
714
715 gravity = frame.getVrtAxis() * (-9.81f * scale.scale);
716
717 tireSlipParams.setToDefault();
718 tireStickyParams.setToDefault();
719
721
722 pvdContext.setToDefault();
723 }
724
725 PX_FORCE_INLINE PxVehicleSimulationContext transformAndScale(
726 const PxVehicleFrame& srcFrame, const PxVehicleFrame& trgFrame, const PxVehicleScale& srcScale, const PxVehicleScale& trgScale) const
727 {
728 PxVehicleSimulationContext c = *this;
729 const PxReal scaleRatio = trgScale.scale / srcScale.scale;
730 c.gravity = trgFrame.getFrame()*srcFrame.getFrame().getTranspose()*c.gravity;
731 c.gravity *= scaleRatio;
732 c.tireSlipParams = tireSlipParams.transformAndScale(srcFrame, trgFrame, srcScale, trgScale);
733 c.tireStickyParams = tireStickyParams.transformAndScale(srcFrame, trgFrame, srcScale, trgScale);
734 c.thresholdForwardSpeedForWheelAngleIntegration *= scaleRatio;
735 c.frame = trgFrame;
736 c.scale = trgScale;
737 return c;
738 }
739};
740
742{
745 {
747 }
748
749 //Road geometry queries to find the plane under the wheel.
750 const PxConvexMesh* physxUnitCylinderSweepMesh;
751 const PxScene* physxScene;
752
753 //PhysX actor update
754 PxVehiclePhysXActorUpdateMode::Enum physxActorUpdateMode;
755
769
779
780
781 PX_FORCE_INLINE void setToDefault()
782 {
783 PxVehicleSimulationContext::setToDefault();
784
785 physxUnitCylinderSweepMesh = NULL;
786 physxScene = NULL;
787
788 physxActorUpdateMode = PxVehiclePhysXActorUpdateMode::eAPPLY_VELOCITY;
789
790 physxActorWakeCounterResetValue = 20.0f * 0.02f; // 20 timesteps of size 0.02
792 }
793
795 const PxVehicleFrame& srcFrame, const PxVehicleFrame& trgFrame, const PxVehicleScale& srcScale, const PxVehicleScale& trgScale) const
796 {
798 static_cast<PxVehicleSimulationContext&>(r) = PxVehicleSimulationContext::transformAndScale(srcFrame, trgFrame, srcScale, trgScale);
799 return r;
800 }
801};
802
806template <class T, unsigned int NB_ELEMENTS>
808{
809public:
810
812 : nbDataPairs(0)
813 {
814 }
815
817 {
818 PxMemCopy(xVals, src.xVals, sizeof(PxReal)* src.nbDataPairs);
819 PxMemCopy(yVals, src.yVals, sizeof(T)*src.nbDataPairs);
820 nbDataPairs = src.nbDataPairs;
821 }
822
824 {
825 }
826
828 {
829 PxMemCopy(xVals, src.xVals, sizeof(PxReal)*src.nbDataPairs);
830 PxMemCopy(yVals, src.yVals, sizeof(T)*src.nbDataPairs);
831 nbDataPairs = src.nbDataPairs;
832 return *this;
833 }
834
838 PX_FORCE_INLINE bool addPair(const PxReal x, const T y)
839 {
840 PX_CHECK_AND_RETURN_VAL(nbDataPairs < NB_ELEMENTS, "PxVehicleFixedSizeLookupTable::addPair() exceeded fixed size capacity", false);
841 xVals[nbDataPairs] = x;
842 yVals[nbDataPairs] = y;
843 nbDataPairs++;
844 return true;
845 }
846
852 PX_FORCE_INLINE T interpolate(const PxReal x) const
853 {
854 if (0 == nbDataPairs)
855 {
856 return T(0);
857 }
858
859 if (1 == nbDataPairs || x < xVals[0])
860 {
861 return yVals[0];
862 }
863
864 PxReal x0 = xVals[0];
865 T y0 = yVals[0];
866
867 for (PxU32 i = 1; i < nbDataPairs; i++)
868 {
869 const PxReal x1 = xVals[i];
870 const T y1 = yVals[i];
871
872 if ((x >= x0) && (x < x1))
873 {
874 return (y0 + (y1 - y0) * (x - x0) / (x1 - x0));
875 }
876
877 x0 = x1;
878 y0 = y1;
879 }
880
881 PX_ASSERT(x >= xVals[nbDataPairs - 1]);
882 return yVals[nbDataPairs - 1];
883 }
884
885 void clear()
886 {
887 PxMemSet(xVals, 0, NB_ELEMENTS * sizeof(PxReal));
888 PxMemSet(yVals, 0, NB_ELEMENTS * sizeof(T));
889 nbDataPairs = 0;
890 }
891
892 PxReal xVals[NB_ELEMENTS];
893 T yVals[NB_ELEMENTS];
894 PxU32 nbDataPairs;
895
896 PX_FORCE_INLINE bool isValid() const
897 {
898 for (PxU32 i = 1; i < nbDataPairs; i++)
899 {
900 PX_CHECK_AND_RETURN_VAL(xVals[i] > xVals[i - 1], "PxVehicleFixedSizeLookupTable:: xVals[i+1] must be greater than xVals[i]", false);
901 }
902 return true;
903 }
904};
905
906#if !PX_DOXYGEN
907} // namespace vehicle2
908} // namespace physx
909#endif
910
911
912
913
Used to write debug information to an OmniPvdWriteStream.
Definition OmniPvdWriter.h:47
A convex mesh.
Definition PxConvexMesh.h:83
3x3 matrix class
Definition PxMat33.h:91
A scene is a collection of bodies and constraints which can interact.
Definition PxScene.h:178
3 Element vector class.
Definition PxVec3.h:50
Express a function as a sequence of points {(x, y)} that form a piecewise polynomial.
Definition PxVehicleParams.h:808
PX_FORCE_INLINE T interpolate(const PxReal x) const
Identify the segment of the piecewise polynomial that includes x and compute the corresponding y valu...
Definition PxVehicleParams.h:852
PX_FORCE_INLINE bool addPair(const PxReal x, const T y)
Add one more point to create one more polynomial segment of a piecewise polynomial.
Definition PxVehicleParams.h:838
qua< float, defaultp > quat
Quaternion of single-precision floating-point numbers.
Definition quaternion_float.hpp:35
#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
PX_FORCE_INLINE void * PxMemSet(void *dest, PxI32 c, PxU32 count)
Sets the bytes of the provided buffer to the specified value.
Definition PxMemory.h:67
PX_FORCE_INLINE void * PxMemCopy(void *dest, const void *src, PxU32 count)
Copies the bytes of one memory block to another. The memory blocks must not overlap.
Definition PxMemory.h:83
PX_FORCE_INLINE void * PxMemZero(void *dest, PxU32 count)
Sets the bytes of the provided buffer to zero.
Definition PxMemory.h:53
Helper struct to pass array type data to vehice components and functions.
Definition PxVehicleParams.h:249
T *const * arrayOfPointers
The data stored as an array of pointers.
Definition PxVehicleParams.h:362
PX_FORCE_INLINE T & getData(PxU32 index)
Get the data entry at a given index.
Definition PxVehicleParams.h:298
PX_FORCE_INLINE bool isEmpty() const
Check if declared as empty.
Definition PxVehicleParams.h:343
T * arrayOfStructs
The data stored as an array of structs.
Definition PxVehicleParams.h:361
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
PX_FORCE_INLINE const PxVehicleArrayData< const T > & getConst() const
Get a reference to the array but read only.
Definition PxVehicleParams.h:353
PX_FORCE_INLINE const T & getData(PxU32 index) const
Get the data entry at a given index.
Definition PxVehicleParams.h:317
PX_FORCE_INLINE void setData(T *const *data)
Set the data as an array of pointers.
Definition PxVehicleParams.h:272
DataFormat
Definition PxVehicleParams.h:251
@ eARRAY_OF_STRUCTS
The data is provided as an array of structs and stored in arrayOfStructs.
Definition PxVehicleParams.h:252
@ eARRAY_OF_POINTERS
The data is provided as an array of pointers and stored in arrayOfPointers.
Definition PxVehicleParams.h:253
Definition PxVehicleParams.h:160
Enum
Definition PxVehicleParams.h:162
@ eNegX
The -x axis.
Definition PxVehicleParams.h:164
@ ePosY
The +y axis.
Definition PxVehicleParams.h:165
@ eNegY
The -y axis.
Definition PxVehicleParams.h:166
@ eNegZ
The -z axis.
Definition PxVehicleParams.h:168
@ ePosZ
The +z axis.
Definition PxVehicleParams.h:167
@ ePosX
The +x axis.
Definition PxVehicleParams.h:163
Definition PxVehicleParams.h:53
PX_FORCE_INLINE PxU32 getNbWheels() const
Return the number of wheels on the vehicle.
Definition PxVehicleParams.h:115
PxU32 wheelIdsInAxleOrder[PxVehicleLimits::eMAX_NB_WHEELS]
The list of all wheel ids on the vehicle.
Definition PxVehicleParams.h:149
PX_FORCE_INLINE PxU32 getNbAxles() const
Return the number of axles on the vehicle.
Definition PxVehicleParams.h:83
PxU32 axleToWheelIds[PxVehicleLimits::eMAX_NB_AXLES]
The list of wheel ids for the ith axle begins at wheelIdsInAxleOrder[axleToWheelIds[i]].
Definition PxVehicleParams.h:147
PX_FORCE_INLINE PxU32 getAxle(const PxU32 wheelId) const
Return the axle of a specified wheel.
Definition PxVehicleParams.h:125
PX_FORCE_INLINE PxU32 getNbWheelsOnAxle(const PxU32 i) const
Return the number of wheels on the ith axle.
Definition PxVehicleParams.h:94
void addAxle(const PxU32 nbWheelsOnAxle, const PxU32 *const wheelIdsOnAxle)
Add an axle to the vehicle by specifying the number of wheels on the axle and an array of wheel ids s...
Definition PxVehicleParams.h:64
PxU32 nbAxles
The number of axles on the vehicle.
Definition PxVehicleParams.h:145
PxU32 nbWheelsPerAxle[PxVehicleLimits::eMAX_NB_AXLES]
The number of wheels on each axle.
Definition PxVehicleParams.h:146
PX_FORCE_INLINE PxU32 getWheelOnAxle(const PxU32 j, const PxU32 i) const
Return the wheel id of the jth wheel on the ith axle.
Definition PxVehicleParams.h:106
PxU32 nbWheels
The number of wheels on the vehicle.
Definition PxVehicleParams.h:150
Definition PxVehicleParams.h:174
PxVehicleAxes::Enum vrtAxis
The axis defining the vertical (up) direction of the vehicle.
Definition PxVehicleParams.h:177
PxVehicleAxes::Enum lngAxis
The axis defining the longitudinal (forward) direction of the vehicle.
Definition PxVehicleParams.h:175
PxVehicleAxes::Enum latAxis
The axis defining the lateral (side) direction of the vehicle.
Definition PxVehicleParams.h:176
Determine whether the PhysX actor associated with a vehicle is to be updated with a velocity change o...
Definition PxVehicleParams.h:425
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
Definition VhPvdAttributeHandles.h:46
Structure to support Omni PVD, the PhysX Visual Debugger.
Definition PxVehicleParams.h:641
const struct PxVehiclePvdAttributeHandles * attributeHandles
The attribute handles used to reflect vehicle parameter and state data in omnipvd.
Definition PxVehicleParams.h:658
OmniPvdWriter * writer
An instance of OmniPvdWriter used to write vehicle prameter and state data to omnipvd.
Definition PxVehicleParams.h:668
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
Definition PxVehicleParams.h:629
Enum
Definition PxVehicleParams.h:631
@ ePHYSX
The simulation context inherits from PxVehiclePhysXSimulationContext.
Definition PxVehicleParams.h:633
@ eDEFAULT
The simulation context inherits from PxVehicleSimulationContext.
Definition PxVehicleParams.h:632
Definition PxVehicleParams.h:672
PxVehiclePvdContext pvdContext
Structure to support Omni PVD, the PhysX Visual Debugger.
Definition PxVehicleParams.h:701
PxReal thresholdForwardSpeedForWheelAngleIntegration
Forward wheel speed below which the wheel rotation speed gets blended with the rolling speed.
Definition PxVehicleParams.h:696
Definition PxVehicleParams.h:369
PX_FORCE_INLINE void setEmpty()
Set as empty.
Definition PxVehicleParams.h:397
PX_FORCE_INLINE void setDataAndCount(T *data, const PxU32 count)
Set the data as an array of structs and set the number of data entries.
Definition PxVehicleParams.h:376
PX_FORCE_INLINE bool isEmpty() const
Check if declared as empty.
Definition PxVehicleParams.h:408
PX_FORCE_INLINE void setDataAndCount(T *const *data, const PxU32 count)
Set the data as an array of pointers and set the number of data entries.
Definition PxVehicleParams.h:388
The low speed regime often presents numerical difficulties for the tire model due to the potential fo...
Definition PxVehicleParams.h:535
PxReal thresholdSpeed
A tire enters the "sticky tire" regime when it has been below a speed specified by thresholdSpeed for...
Definition PxVehicleParams.h:543
PxReal thresholdTime
A tire enters the "sticky tire" regime when it has been below a speed specified by thresholdSpeed for...
Definition PxVehicleParams.h:552
PxReal damping
The rate at which the velocity constraint approaches zero is controlled by the damping parameter.
Definition PxVehicleParams.h:562
Tires have two important directions for the purposes of tire force computation: longitudinal and late...
Definition PxVehicleParams.h:517
Tire slip values are computed using ratios with potential for divide-by-zero errors....
Definition PxVehicleParams.h:438
PxReal minPassiveLongSlipDenominator
The longitudinal slip represents the difference between the longitudinal speed of the rigid body in t...
Definition PxVehicleParams.h:466
PxReal minLatSlipDenominator
The lateral slip angle is typically computed as a function of the ratio of lateral and longitudinal s...
Definition PxVehicleParams.h:449
PxReal minActiveLongSlipDenominator
The longitudinal slip represents the difference between the longitudinal speed of the rigid body in t...
Definition PxVehicleParams.h:482
For each tire, the forces of the tire model may be replaced by velocity constraints when the tire ent...
Definition PxVehicleParams.h:590
PxVehicleTireAxisStickyParams stickyParams[PxVehicleTireDirectionModes::eMAX_NB_PLANAR_DIRECTIONS]
Definition PxVehicleParams.h:595