RavEngine
Loading...
Searching...
No Matches
VhPvdWriter.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
30
31#include "vehicle2/braking/PxVehicleBrakingParams.h"
32#include "vehicle2/drivetrain/PxVehicleDrivetrainParams.h"
33#include "vehicle2/drivetrain/PxVehicleDrivetrainStates.h"
34#include "vehicle2/physxConstraints/PxVehiclePhysXConstraintParams.h"
35#include "vehicle2/physxConstraints/PxVehiclePhysXConstraintStates.h"
36#include "vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryParams.h"
37#include "vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryState.h"
38#include "vehicle2/rigidBody/PxVehicleRigidBodyParams.h"
39#include "vehicle2/rigidBody/PxVehicleRigidBodyStates.h"
40#include "vehicle2/steering/PxVehicleSteeringParams.h"
41#include "vehicle2/suspension/PxVehicleSuspensionParams.h"
42#include "vehicle2/suspension/PxVehicleSuspensionStates.h"
43#include "vehicle2/tire/PxVehicleTireParams.h"
44#include "vehicle2/tire/PxVehicleTireStates.h"
45#include "vehicle2/wheel/PxVehicleWheelParams.h"
46#include "vehicle2/wheel/PxVehicleWheelStates.h"
47
48#if PX_SUPPORT_OMNI_PVD
49#include "OmniPvdWriter.h"
50#endif
51
56#if PX_SUPPORT_OMNI_PVD
57
58#if !PX_DOXYGEN
59namespace physx
60{
61namespace vehicle2
62{
63#endif
64
66//RIGID BODY
68
69struct RigidBodyParams
70{
71 OmniPvdClassHandle CH;
72 OmniPvdAttributeHandle moiAH;
73 OmniPvdAttributeHandle massAH;
74};
75
76struct RigidBodyState
77{
78 OmniPvdClassHandle CH;
79 OmniPvdAttributeHandle posAH;
80 OmniPvdAttributeHandle quatAH;
81 OmniPvdAttributeHandle linearVelocityAH;
82 OmniPvdAttributeHandle angularVelocityAH;
83 OmniPvdAttributeHandle previousLinearVelocityAH;
84 OmniPvdAttributeHandle previousAngularVelocityAH;
85 OmniPvdAttributeHandle externalForceAH;
86 OmniPvdAttributeHandle externalTorqueAH;
87};
88
89RigidBodyParams registerRigidBodyParams(OmniPvdWriter* omniWriter);
90RigidBodyState registerRigidBodyState(OmniPvdWriter* omniWriter);
91
92void writeRigidBodyParams
93(const PxVehicleRigidBodyParams& rbodyParams,
94 const OmniPvdObjectHandle oh, const RigidBodyParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
95
96void writeRigidBodyState
97(const PxVehicleRigidBodyState& rbodyParams,
98 const OmniPvdObjectHandle oh, const RigidBodyState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
99
100
102//CONTROL
104
105struct WheelResponseParams
106{
107 OmniPvdClassHandle CH;
108 OmniPvdAttributeHandle responseMultipliers0To3AH;
109 OmniPvdAttributeHandle responseMultipliers4To7AH;
110 OmniPvdAttributeHandle responseMultipliers8To11AH;
111 OmniPvdAttributeHandle responseMultipliers12To15AH;
112 OmniPvdAttributeHandle responseMultipliers16To19AH;
113 OmniPvdAttributeHandle maxResponseAH;
114};
115
116struct WheelResponseStates
117{
118 OmniPvdClassHandle CH;
119 OmniPvdAttributeHandle responseStates0To3AH;
120 OmniPvdAttributeHandle responseStates4To7AH;
121 OmniPvdAttributeHandle responseStates8To11AH;
122 OmniPvdAttributeHandle responseStates12To15AH;
123 OmniPvdAttributeHandle responseStates16To19AH;
124};
125
126
127
128WheelResponseParams registerSteerResponseParams(OmniPvdWriter* omniWriter);
129WheelResponseParams registerBrakeResponseParams(OmniPvdWriter* omniWriter);
130WheelResponseStates registerSteerResponseStates(OmniPvdWriter* omniWriter);
131WheelResponseStates registerBrakeResponseStates(OmniPvdWriter* omniWriter);
132
133void writeSteerResponseParams
134(const PxVehicleAxleDescription& axleDesc,
135 const PxVehicleSteerCommandResponseParams& steerResponseParams,
136 const OmniPvdObjectHandle oh, const WheelResponseParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
137
138void writeBrakeResponseParams
139(const PxVehicleAxleDescription& axleDesc,
140 const PxVehicleBrakeCommandResponseParams& brakeResponseParams,
141 const OmniPvdObjectHandle oh, const WheelResponseParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
142
143void writeSteerResponseStates
144(const PxVehicleAxleDescription& axleDesc,
145 const PxVehicleArrayData<PxReal>& steerResponseStates,
146 const OmniPvdObjectHandle oh, const WheelResponseStates& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
147
148void writeBrakeResponseStates
149(const PxVehicleAxleDescription& axleDesc,
150 const PxVehicleArrayData<PxReal>& brakeResponseStates,
151 const OmniPvdObjectHandle oh, const WheelResponseStates& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
152
154//WHEEL ATTACHMENTS
156
157struct WheelParams
158{
159 OmniPvdClassHandle CH;
160 OmniPvdAttributeHandle wheelRadiusAH;
161 OmniPvdAttributeHandle halfWidthAH;
162 OmniPvdAttributeHandle massAH;
163 OmniPvdAttributeHandle moiAH;
164 OmniPvdAttributeHandle dampingRateAH;
165};
166
167struct WheelActuationState
168{
169 OmniPvdClassHandle CH;
170 OmniPvdAttributeHandle isBrakeAppliedAH;
171 OmniPvdAttributeHandle isDriveAppliedAH;
172};
173
174struct WheelRigidBody1dState
175{
176 OmniPvdClassHandle CH;
177 OmniPvdAttributeHandle rotationSpeedAH;
178 OmniPvdAttributeHandle correctedRotationSpeedAH;
179 OmniPvdAttributeHandle rotationAngleAH;
180};
181
182struct WheelLocalPoseState
183{
184 OmniPvdClassHandle CH;
185 OmniPvdAttributeHandle posAH;
186 OmniPvdAttributeHandle quatAH;
187};
188
189struct RoadGeometryState
190{
191 OmniPvdClassHandle CH;
192 OmniPvdAttributeHandle planeAH;
193 OmniPvdAttributeHandle frictionAH;
194 OmniPvdAttributeHandle velocityAH;
195 OmniPvdAttributeHandle hitStateAH;
196};
197
198struct SuspParams
199{
200 OmniPvdClassHandle CH;
201
202 OmniPvdAttributeHandle suspAttachmentPosAH;
203 OmniPvdAttributeHandle suspAttachmentQuatAH;
204 OmniPvdAttributeHandle suspDirAH;
205 OmniPvdAttributeHandle suspTravleDistAH;
206 OmniPvdAttributeHandle wheelAttachmentPosAH;
207 OmniPvdAttributeHandle wheelAttachmentQuatAH;
208};
209
210struct SuspCompParams
211{
212 OmniPvdClassHandle CH;
213 OmniPvdAttributeHandle toeAngleAH;
214 OmniPvdAttributeHandle camberAngleAH;
215 OmniPvdAttributeHandle suspForceAppPointAH;
216 OmniPvdAttributeHandle tireForceAppPointAH;
217};
218
219struct SuspForceParams
220{
221 OmniPvdClassHandle CH;
222 OmniPvdAttributeHandle stiffnessAH;
223 OmniPvdAttributeHandle dampingAH;
224 OmniPvdAttributeHandle sprungMassAH;
225};
226
227struct SuspState
228{
229 OmniPvdClassHandle CH;
230 OmniPvdAttributeHandle jounceAH;
231 OmniPvdAttributeHandle jounceSpeedAH;
232 OmniPvdAttributeHandle separationAH;
233};
234
235struct SuspCompState
236{
237 OmniPvdClassHandle CH;
238 OmniPvdAttributeHandle toeAH;
239 OmniPvdAttributeHandle camberAH;
240 OmniPvdAttributeHandle tireForceAppPointAH;
241 OmniPvdAttributeHandle suspForceAppPointAH;
242};
243
244struct SuspForce
245{
246 OmniPvdClassHandle CH;
247 OmniPvdAttributeHandle forceAH;
248 OmniPvdAttributeHandle torqueAH;
249 OmniPvdAttributeHandle normalForceAH;
250};
251
252struct TireParams
253{
254 OmniPvdClassHandle CH;
255 OmniPvdAttributeHandle latStiffXAH;
256 OmniPvdAttributeHandle latStiffYAH;
257 OmniPvdAttributeHandle longStiffAH;
258 OmniPvdAttributeHandle camberStiffAH;
259 OmniPvdAttributeHandle frictionVsSlipAH;
260 OmniPvdAttributeHandle restLoadAH;
261 OmniPvdAttributeHandle loadFilterAH;
262};
263
264struct TireDirectionState
265{
266 OmniPvdClassHandle CH;
267 OmniPvdAttributeHandle lngDirectionAH;
268 OmniPvdAttributeHandle latDirectionAH;
269};
270
271struct TireSpeedState
272{
273 OmniPvdClassHandle CH;
274 OmniPvdAttributeHandle lngSpeedAH;
275 OmniPvdAttributeHandle latSpeedAH;
276
277};
278
279struct TireSlipState
280{
281 OmniPvdClassHandle CH;
282 OmniPvdAttributeHandle lngSlipAH;
283 OmniPvdAttributeHandle latSlipAH;
284};
285
286struct TireGripState
287{
288 OmniPvdClassHandle CH;
289 OmniPvdAttributeHandle loadAH;
290 OmniPvdAttributeHandle frictionAH;
291};
292
293struct TireCamberState
294{
295 OmniPvdClassHandle CH;
296 OmniPvdAttributeHandle camberAngleAH;
297};
298
299struct TireStickyState
300{
301 OmniPvdClassHandle CH;
302 OmniPvdAttributeHandle lngStickyStateTimer;
303 OmniPvdAttributeHandle lngStickyStateStatus;
304 OmniPvdAttributeHandle latStickyStateTimer;
305 OmniPvdAttributeHandle latStickyStateStatus;
306};
307
308struct TireForce
309{
310 OmniPvdClassHandle CH;
311
312 OmniPvdAttributeHandle lngForceAH;
313 OmniPvdAttributeHandle lngTorqueAH;
314
315 OmniPvdAttributeHandle latForceAH;
316 OmniPvdAttributeHandle latTorqueAH;
317
318 OmniPvdAttributeHandle aligningMomentAH;
319 OmniPvdAttributeHandle wheelTorqueAH;
320};
321
322struct WheelAttachment
323{
324 OmniPvdClassHandle CH;
325
326 OmniPvdAttributeHandle wheelParamsAH;
327 OmniPvdAttributeHandle wheelActuationStateAH;
328 OmniPvdAttributeHandle wheelRigidBody1dStateAH;
329 OmniPvdAttributeHandle wheelLocalPoseStateAH;
330
331 OmniPvdAttributeHandle roadGeomStateAH;
332
333 OmniPvdAttributeHandle suspParamsAH;
334 OmniPvdAttributeHandle suspCompParamsAH;
335 OmniPvdAttributeHandle suspForceParamsAH;
336 OmniPvdAttributeHandle suspStateAH;
337 OmniPvdAttributeHandle suspCompStateAH;
338 OmniPvdAttributeHandle suspForceAH;
339
340 OmniPvdAttributeHandle tireParamsAH;
341 OmniPvdAttributeHandle tireDirectionStateAH;
342 OmniPvdAttributeHandle tireSpeedStateAH;
343 OmniPvdAttributeHandle tireSlipStateAH;
344 OmniPvdAttributeHandle tireStickyStateAH;
345 OmniPvdAttributeHandle tireGripStateAH;
346 OmniPvdAttributeHandle tireCamberStateAH;
347 OmniPvdAttributeHandle tireForceAH;
348};
349
350WheelParams registerWheelParams(OmniPvdWriter* omniWriter);
351WheelActuationState registerWheelActuationState(OmniPvdWriter* omniWriter);
352WheelRigidBody1dState registerWheelRigidBody1dState(OmniPvdWriter* omniWriter);
353WheelLocalPoseState registerWheelLocalPoseState(OmniPvdWriter* omniWriter);
354RoadGeometryState registerRoadGeomState(OmniPvdWriter* omniWriter);
355SuspParams registerSuspParams(OmniPvdWriter* omniWriter);
356SuspCompParams registerSuspComplianceParams(OmniPvdWriter* omniWriter);
357SuspForceParams registerSuspForceParams(OmniPvdWriter* omniWriter);
358SuspState registerSuspState(OmniPvdWriter* omniWriter);
359SuspCompState registerSuspComplianceState(OmniPvdWriter* omniWriter);
360SuspForce registerSuspForce(OmniPvdWriter* omniWriter);
361TireParams registerTireParams(OmniPvdWriter* omniWriter);
362TireDirectionState registerTireDirectionState(OmniPvdWriter* omniWriter);
363TireSpeedState registerTireSpeedState(OmniPvdWriter* omniWriter);
364TireSlipState registerTireSlipState(OmniPvdWriter* omniWriter);
365TireStickyState registerTireStickyState(OmniPvdWriter* omniWriter);
366TireGripState registerTireGripState(OmniPvdWriter* omniWriter);
367TireCamberState registerTireCamberState(OmniPvdWriter* omniWriter);
368TireForce registerTireForce(OmniPvdWriter* omniWriter);
369WheelAttachment registerWheelAttachment(OmniPvdWriter* omniWriter);
370
371void writeWheelParams
372(const PxVehicleWheelParams& params,
373 const OmniPvdObjectHandle oh, const WheelParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
374
375void writeWheelActuationState
376(const PxVehicleWheelActuationState& actState,
377 const OmniPvdObjectHandle oh, const WheelActuationState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
378
379void writeWheelRigidBody1dState
380(const PxVehicleWheelRigidBody1dState& rigidBodyState,
381 const OmniPvdObjectHandle oh, const WheelRigidBody1dState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
382
383void writeWheelLocalPoseState
384(const PxVehicleWheelLocalPose& pose,
385 const OmniPvdObjectHandle oh, const WheelLocalPoseState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
386
387void writeRoadGeomState
388(const PxVehicleRoadGeometryState& roadGeometryState,
389 const OmniPvdObjectHandle oh, const RoadGeometryState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
390
391void writeSuspParams
392(const PxVehicleSuspensionParams& suspParams,
393 const OmniPvdObjectHandle oh, const SuspParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
394
395void writeSuspComplianceParams
396(const PxVehicleSuspensionComplianceParams& compParams,
397 const OmniPvdObjectHandle oh, const SuspCompParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
398
399void writeSuspForceParams
400(const PxVehicleSuspensionForceParams& forceParams,
401 const OmniPvdObjectHandle oh, const SuspForceParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
402
403void writeSuspState
404(const PxVehicleSuspensionState& suspState,
405 const OmniPvdObjectHandle oh, const SuspState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
406
407void writeSuspComplianceState
408(const PxVehicleSuspensionComplianceState& suspCompState,
409 const OmniPvdObjectHandle oh, const SuspCompState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
410
411void writeSuspForce
412(const PxVehicleSuspensionForce& suspForce,
413 const OmniPvdObjectHandle oh, const SuspForce& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
414
415void writeTireParams
416(const PxVehicleTireForceParams& tireParams,
417 const OmniPvdObjectHandle oh, const TireParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
418
419void writeTireDirectionState
420(const PxVehicleTireDirectionState& tireDirState,
421 const OmniPvdObjectHandle oh, const TireDirectionState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
422
423void writeTireSpeedState
424(const PxVehicleTireSpeedState& tireSpeedState,
425 const OmniPvdObjectHandle oh, const TireSpeedState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
426
427void writeTireSlipState
428(const PxVehicleTireSlipState& tireSlipState,
429 const OmniPvdObjectHandle oh, const TireSlipState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
430
431void writeTireStickyState
432(const PxVehicleTireStickyState& tireStickyState,
433 const OmniPvdObjectHandle oh, const TireStickyState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
434
435void writeTireGripState
436(const PxVehicleTireGripState& tireGripState,
437 const OmniPvdObjectHandle oh, const TireGripState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
438
439void writeTireCamberState
440(const PxVehicleTireCamberAngleState& tireCamberState,
441 const OmniPvdObjectHandle oh, const TireCamberState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
442
443void writeTireForce
444(const PxVehicleTireForce& tireForce,
445 const OmniPvdObjectHandle oh, const TireForce& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
446
448//ANTIROLL
450
451struct AntiRollParams
452{
453 OmniPvdClassHandle CH;
454 OmniPvdAttributeHandle wheel0AH;
455 OmniPvdAttributeHandle wheel1AH;
456 OmniPvdAttributeHandle stiffnessAH;
457};
458
459struct AntiRollForce
460{
461 OmniPvdClassHandle CH;
462 OmniPvdAttributeHandle torqueAH;
463};
464
465AntiRollParams registerAntiRollParams(OmniPvdWriter* omniWriter);
466AntiRollForce registerAntiRollForce(OmniPvdWriter* omniWriter);
467
468void writeAntiRollParams
469(const PxVehicleAntiRollForceParams& antiRollParams,
470 const OmniPvdObjectHandle oh, const AntiRollParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
471
472void writeAntiRollForce
473(const PxVehicleAntiRollTorque& antiRollForce,
474 const OmniPvdObjectHandle oh, const AntiRollForce& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
475
477//SUSPENSION STATE CALCULATION
479
480struct SuspStateCalcParams
481{
482 OmniPvdClassHandle CH;
483 OmniPvdAttributeHandle calcTypeAH;
484 OmniPvdAttributeHandle limitExpansionValAH;
485};
486
487SuspStateCalcParams registerSuspStateCalcParams(OmniPvdWriter* omniWriter);
488
489void writeSuspStateCalcParams
490(const PxVehicleSuspensionStateCalculationParams& suspStateCalcParams,
491 const OmniPvdObjectHandle oh, const SuspStateCalcParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
492
494//DIRECT DRIVETRAIN
496
497struct DirectDriveCommandState
498{
499 OmniPvdClassHandle CH;
500 OmniPvdAttributeHandle brakesAH;
501 OmniPvdAttributeHandle throttleAH;
502 OmniPvdAttributeHandle steerAH;
503};
504
505struct DirectDriveTransmissionCommandState
506{
507 OmniPvdClassHandle CH;
508 OmniPvdAttributeHandle gearAH;
509};
510
511struct DirectDriveThrottleResponseState
512{
513 OmniPvdClassHandle CH;
514 OmniPvdAttributeHandle states0To3AH;
515 OmniPvdAttributeHandle states4To7AH;
516 OmniPvdAttributeHandle states8To11AH;
517 OmniPvdAttributeHandle states12To15AH;
518 OmniPvdAttributeHandle states16To19AH;
519};
520
521struct DirectDrivetrain
522{
523 OmniPvdClassHandle CH;
524 OmniPvdAttributeHandle throttleResponseParamsAH;
525 OmniPvdAttributeHandle commandStateAH;
526 OmniPvdAttributeHandle throttleResponseStateAH;
527};
528
529WheelResponseParams registerDirectDriveThrottleResponseParams(OmniPvdWriter* omniWriter);
530DirectDriveCommandState registerDirectDriveCommandState(OmniPvdWriter* omniWriter);
531DirectDriveTransmissionCommandState registerDirectDriveTransmissionCommandState(OmniPvdWriter* omniWriter);
532DirectDriveThrottleResponseState registerDirectDriveThrottleResponseState(OmniPvdWriter* omniWriter);
533DirectDrivetrain registerDirectDrivetrain(OmniPvdWriter* omniWriter);
534
535void writeDirectDriveThrottleResponseParams
536(const PxVehicleAxleDescription& axleDesc,
537 const PxVehicleDirectDriveThrottleCommandResponseParams& directDriveThrottleResponseParams,
538 const OmniPvdObjectHandle oh, const WheelResponseParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
539
540void writeDirectDriveCommandState
541(const PxVehicleCommandState& commands,
542 const OmniPvdObjectHandle oh, const DirectDriveCommandState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
543
544void writeDirectDriveTransmissionCommandState
545(const PxVehicleDirectDriveTransmissionCommandState& transmission,
546 const OmniPvdObjectHandle oh, const DirectDriveTransmissionCommandState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
547
548void writeDirectDriveThrottleResponseState
549(const PxVehicleAxleDescription& axleDesc, const PxVehicleArrayData<PxReal>& throttleResponseState,
550 const OmniPvdObjectHandle oh, const DirectDriveThrottleResponseState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
551
552
554//ENGINE DRIVETRAIN
556
557struct EngineDriveCommandState
558{
559 OmniPvdClassHandle CH;
560 OmniPvdAttributeHandle brakes;
561 OmniPvdAttributeHandle throttle;
562 OmniPvdAttributeHandle steer;
563};
564
565struct EngineDriveTransmissionCommandState
566{
567 OmniPvdClassHandle CH;
568 OmniPvdAttributeHandle gearAH;
569 OmniPvdAttributeHandle clutchAH;
570};
571
572struct ClutchResponseParams
573{
574 OmniPvdClassHandle CH;
575 OmniPvdAttributeHandle maxResponseAH;
576};
577
578struct ClutchParams
579{
580 OmniPvdClassHandle CH;
581 OmniPvdAttributeHandle accuracyAH;
582 OmniPvdAttributeHandle iterationsAH;
583};
584
585struct EngineParams
586{
587 OmniPvdClassHandle CH;
588 OmniPvdAttributeHandle torqueCurveAH;
589 OmniPvdAttributeHandle moiAH;
590 OmniPvdAttributeHandle peakTorqueAH;
591 OmniPvdAttributeHandle idleOmegaAH;
592 OmniPvdAttributeHandle maxOmegaAH;
593 OmniPvdAttributeHandle dampingRateFullThrottleAH;
594 OmniPvdAttributeHandle dampingRateZeroThrottleClutchEngagedAH;
595 OmniPvdAttributeHandle dampingRateZeroThrottleClutchDisengagedAH;
596};
597
598struct GearboxParams
599{
600 OmniPvdClassHandle CH;
601 OmniPvdAttributeHandle ratiosAH;
602 OmniPvdAttributeHandle nbRatiosAH;
603 OmniPvdAttributeHandle neutralGearAH;
604 OmniPvdAttributeHandle finalRatioAH;
605 OmniPvdAttributeHandle switchTimeAH;
606};
607
608struct AutoboxParams
609{
610 OmniPvdClassHandle CH;
611 OmniPvdAttributeHandle upRatiosAH;
612 OmniPvdAttributeHandle downRatiosAH;
613 OmniPvdAttributeHandle latencyAH;
614};
615
616struct MultiWheelDiffParams
617{
618 OmniPvdClassHandle CH;
619 OmniPvdAttributeHandle torqueRatios0To3AH;
620 OmniPvdAttributeHandle torqueRatios4To7AH;
621 OmniPvdAttributeHandle torqueRatios8To11AH;
622 OmniPvdAttributeHandle torqueRatios12To15AH;
623 OmniPvdAttributeHandle torqueRatios16To19AH;
624 OmniPvdAttributeHandle aveWheelSpeedRatios0To3AH;
625 OmniPvdAttributeHandle aveWheelSpeedRatios4To7AH;
626 OmniPvdAttributeHandle aveWheelSpeedRatios8To11AH;
627 OmniPvdAttributeHandle aveWheelSpeedRatios12To15AH;
628 OmniPvdAttributeHandle aveWheelSpeedRatios16To19AH;
629};
630
631struct FourWheelDiffParams : public MultiWheelDiffParams
632{
633 OmniPvdAttributeHandle frontWheelsAH;
634 OmniPvdAttributeHandle rearWheelsAH;
635 OmniPvdAttributeHandle frontBiasAH;
636 OmniPvdAttributeHandle frontTargetAH;
637 OmniPvdAttributeHandle rearBiasAH;
638 OmniPvdAttributeHandle rearTargetAH;
639 OmniPvdAttributeHandle centreBiasAH;
640 OmniPvdAttributeHandle centreTargetAH;
641};
642
643struct ClutchResponseState
644{
645 OmniPvdClassHandle CH;
646 OmniPvdAttributeHandle normalisedResponseAH;
647 OmniPvdAttributeHandle responseAH;
648};
649
650struct ThrottleResponseState
651{
652 OmniPvdClassHandle CH;
653 OmniPvdAttributeHandle responseAH;
654};
655
656struct EngineState
657{
658 OmniPvdClassHandle CH;
659 OmniPvdAttributeHandle rotationSpeedAH;
660};
661
662struct GearboxState
663{
664 OmniPvdClassHandle CH;
665 OmniPvdAttributeHandle currentGearAH;
666 OmniPvdAttributeHandle targetGearAH;
667 OmniPvdAttributeHandle switchTimeAH;
668};
669
670struct AutoboxState
671{
672 OmniPvdClassHandle CH;
673 OmniPvdAttributeHandle timeSinceLastShiftAH;
674 OmniPvdAttributeHandle activeAutoboxGearShiftAH;
675};
676
677struct DiffState
678{
679 OmniPvdClassHandle CH;
680 OmniPvdAttributeHandle torqueRatios0To3AH;
681 OmniPvdAttributeHandle torqueRatios4To7AH;
682 OmniPvdAttributeHandle torqueRatios8To11AH;
683 OmniPvdAttributeHandle torqueRatios12To15AH;
684 OmniPvdAttributeHandle torqueRatios16To19AH;
685 OmniPvdAttributeHandle aveWheelSpeedRatios0To3AH;
686 OmniPvdAttributeHandle aveWheelSpeedRatios4To7AH;
687 OmniPvdAttributeHandle aveWheelSpeedRatios8To11AH;
688 OmniPvdAttributeHandle aveWheelSpeedRatios12To15AH;
689 OmniPvdAttributeHandle aveWheelSpeedRatios16To19AH;
690};
691
692struct ClutchSlipState
693{
694 OmniPvdClassHandle CH;
695 OmniPvdAttributeHandle slipAH;
696};
697
698struct EngineDrivetrain
699{
700 OmniPvdClassHandle CH;
701 OmniPvdAttributeHandle commandStateAH;
702 OmniPvdAttributeHandle transmissionCommandStateAH;
703 OmniPvdAttributeHandle clutchResponseParamsAH;
704 OmniPvdAttributeHandle clutchParamsAH;
705 OmniPvdAttributeHandle engineParamsAH;
706 OmniPvdAttributeHandle gearboxParamsAH;
707 OmniPvdAttributeHandle autoboxParamsAH;
708 OmniPvdAttributeHandle multiWheelDiffParamsAH;
709 OmniPvdAttributeHandle fourWheelDiffParamsAH;
710 OmniPvdAttributeHandle clutchResponseStateAH;
711 OmniPvdAttributeHandle throttleResponseStateAH;
712 OmniPvdAttributeHandle engineStateAH;
713 OmniPvdAttributeHandle gearboxStateAH;
714 OmniPvdAttributeHandle autoboxStateAH;
715 OmniPvdAttributeHandle diffStateAH;
716 OmniPvdAttributeHandle clutchSlipStateAH;
717};
718
719EngineDriveCommandState registerEngineDriveCommandState(OmniPvdWriter* omniWriter);
720EngineDriveTransmissionCommandState registerEngineDriveTransmissionCommandState(OmniPvdWriter* omniWriter);
721ClutchResponseParams registerClutchResponseParams(OmniPvdWriter* omniWriter);
722ClutchParams registerClutchParams(OmniPvdWriter* omniWriter);
723EngineParams registerEngineParams(OmniPvdWriter* omniWriter);
724GearboxParams registerGearboxParams(OmniPvdWriter* omniWriter);
725AutoboxParams registerAutoboxParams(OmniPvdWriter* omniWriter);
726MultiWheelDiffParams registerMultiWheelDiffParams(OmniPvdWriter* omniWriter);
727FourWheelDiffParams registerFourWheelDiffParams(OmniPvdWriter* omniWriter);
728//TankDiffParams registerTankDiffParams(OmniPvdWriter* omniWriter);
729ClutchResponseState registerClutchResponseState(OmniPvdWriter* omniWriter);
730ThrottleResponseState registerThrottleResponseState(OmniPvdWriter* omniWriter);
731EngineState registerEngineState(OmniPvdWriter* omniWriter);
732GearboxState registerGearboxState(OmniPvdWriter* omniWriter);
733AutoboxState registerAutoboxState(OmniPvdWriter* omniWriter);
734DiffState registerDiffState(OmniPvdWriter* omniWriter);
735ClutchSlipState registerClutchSlipState(OmniPvdWriter* omniWriter);
736EngineDrivetrain registerEngineDrivetrain(OmniPvdWriter* omniWriter);
737
738void writeEngineDriveCommandState
739(const PxVehicleCommandState& commandState,
740 const OmniPvdObjectHandle oh, const EngineDriveCommandState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
741
742void writeEngineDriveTransmissionCommandState
743(const PxVehicleEngineDriveTransmissionCommandState& transmission,
744 const OmniPvdObjectHandle oh, const EngineDriveTransmissionCommandState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
745
746void writeClutchResponseParams
747(const PxVehicleClutchCommandResponseParams& clutchResponseParams,
748 const OmniPvdObjectHandle oh, const ClutchResponseParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
749
750void writeClutchParams
751(const PxVehicleClutchParams& clutchParams,
752 const OmniPvdObjectHandle oh, const ClutchParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
753
754void writeEngineParams
755(const PxVehicleEngineParams& engineParams,
756 const OmniPvdObjectHandle oh, const EngineParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
757
758void writeGearboxParams
759(const PxVehicleGearboxParams& gearboxParams,
760 const OmniPvdObjectHandle oh, const GearboxParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
761
762void writeAutoboxParams
763(const PxVehicleAutoboxParams& gearboxParams,
764 const OmniPvdObjectHandle oh, const AutoboxParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
765
766void writeMultiWheelDiffParams
767(const PxVehicleMultiWheelDriveDifferentialParams& diffParams,
768 const OmniPvdObjectHandle oh, const MultiWheelDiffParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
769
770void writeFourWheelDiffParams
771(const PxVehicleFourWheelDriveDifferentialParams& diffParams,
772 const OmniPvdObjectHandle oh, const FourWheelDiffParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
773
774void writeClutchResponseState
775(const PxVehicleClutchCommandResponseState& clutchResponseState,
776 const OmniPvdObjectHandle oh, const ClutchResponseState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
777
778void writeThrottleResponseState
779(const PxVehicleEngineDriveThrottleCommandResponseState& throttleResponseState,
780 const OmniPvdObjectHandle oh, const ThrottleResponseState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
781
782void writeEngineState
783(const PxVehicleEngineState& engineState,
784 const OmniPvdObjectHandle oh, const EngineState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
785
786void writeGearboxState
787(const PxVehicleGearboxState& gearboxState,
788 const OmniPvdObjectHandle oh, const GearboxState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
789
790void writeAutoboxState
791(const PxVehicleAutoboxState& gearboxState,
792 const OmniPvdObjectHandle oh, const AutoboxState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
793
794void writeDiffState
795(const PxVehicleDifferentialState& diffState,
796 const OmniPvdObjectHandle oh, const DiffState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
797
798void writeClutchSlipState
799(const PxVehicleClutchSlipState& clutchSlipState,
800 const OmniPvdObjectHandle oh, const ClutchSlipState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
801
803//WHEEL ATTACHMENT PHYSX INTEGRATION
805
806struct PhysXSuspensionLimitConstraintParams
807{
808 OmniPvdClassHandle CH;
809 OmniPvdAttributeHandle restitutionAH;
810 OmniPvdAttributeHandle directionForSuspensionLimitConstraintAH;
811};
812
813struct PhysXWheelShape
814{
815 OmniPvdClassHandle CH;
816 OmniPvdAttributeHandle shapePtrAH;
817};
818
819struct PhysXRoadGeomState
820{
821 OmniPvdClassHandle CH;
822 OmniPvdAttributeHandle hitActorPtrAH;
823 OmniPvdAttributeHandle hitShapePtrAH;
824 OmniPvdAttributeHandle hitMaterialPtrAH;
825 OmniPvdAttributeHandle hitPositionAH;
826};
827
828struct PhysXConstraintState
829{
830 OmniPvdClassHandle CH;
831
832 OmniPvdAttributeHandle tireLongActiveStatusAH;
833 OmniPvdAttributeHandle tireLongLinearAH;
834 OmniPvdAttributeHandle tireLongAngularAH;
835 OmniPvdAttributeHandle tireLongDampingAH;
836
837 OmniPvdAttributeHandle tireLatActiveStatusAH;
838 OmniPvdAttributeHandle tireLatLinearAH;
839 OmniPvdAttributeHandle tireLatAngularAH;
840 OmniPvdAttributeHandle tireLatDampingAH;
841
842 OmniPvdAttributeHandle suspActiveStatusAH;
843 OmniPvdAttributeHandle suspLinearAH;
844 OmniPvdAttributeHandle suspAngularAH;
845 OmniPvdAttributeHandle suspGeometricErrorAH;
846 OmniPvdAttributeHandle suspRestitutionAH;
847};
848
849struct PhysXWheelAttachment
850{
851 OmniPvdClassHandle CH;
852 OmniPvdAttributeHandle physxWeelShapeAH;
853 OmniPvdAttributeHandle physxConstraintParamsAH;
854 OmniPvdAttributeHandle physxRoadGeometryStateAH;
855 OmniPvdAttributeHandle physxConstraintStateAH;
856 OmniPvdAttributeHandle physxMaterialFrictionSetAH;
857};
858
859struct PhysXMaterialFriction
860{
861 OmniPvdClassHandle CH;
862 OmniPvdAttributeHandle frictionAH;
863 OmniPvdAttributeHandle materialPtrAH;
864};
865
866PhysXSuspensionLimitConstraintParams registerSuspLimitConstraintParams(OmniPvdWriter* omniWriter);
867PhysXWheelShape registerPhysXWheelShape(OmniPvdWriter* omniWriter);
868PhysXRoadGeomState registerPhysXRoadGeomState(OmniPvdWriter* omniWriter);
869PhysXConstraintState registerPhysXConstraintState(OmniPvdWriter* omniWriter);
870PhysXWheelAttachment registerPhysXWheelAttachment(OmniPvdWriter* omniWriter);
871PhysXMaterialFriction registerPhysXMaterialFriction(OmniPvdWriter* omniWriter);
872
873void writePhysXSuspLimitConstraintParams
874(const PxVehiclePhysXSuspensionLimitConstraintParams& params,
875 const OmniPvdObjectHandle oh, const PhysXSuspensionLimitConstraintParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
876
877void writePhysXWheelShape
878(const PxShape* wheelShape,
879 const OmniPvdObjectHandle oh, const PhysXWheelShape& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
880
881void writePhysXRoadGeomState
882(const PxVehiclePhysXRoadGeometryQueryState& roadGeomState,
883const OmniPvdObjectHandle oh, const PhysXRoadGeomState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
884
885void writePhysXConstraintState
886(const PxVehiclePhysXConstraintState& roadGeomState,
887 const OmniPvdObjectHandle oh, const PhysXConstraintState& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
888
889void writePhysXMaterialFriction
890(const PxVehiclePhysXMaterialFriction& materialFriction,
891 const OmniPvdObjectHandle oh, const PhysXMaterialFriction& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
892
894//PHYSX RIGID ACTOR
896
897struct PhysXRoadGeometryQueryParams
898{
899 OmniPvdClassHandle CH;
900 OmniPvdAttributeHandle queryTypeAH;
901};
902
903struct PhysXRigidActor
904{
905 OmniPvdClassHandle CH;
906 OmniPvdAttributeHandle rigidActorAH;
907};
908
909
910PhysXRoadGeometryQueryParams registerPhysXRoadGeometryQueryParams(OmniPvdWriter* omniWriter);
911PhysXRigidActor registerPhysXRigidActor(OmniPvdWriter* omniWriter);
912
913void writePhysXRigidActor
914(const PxRigidActor* actor,
915 const OmniPvdObjectHandle oh, const PhysXRigidActor& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
916
917void writePhysXRoadGeometryQueryParams
918(const PxVehiclePhysXRoadGeometryQueryParams& actor,
919 const OmniPvdObjectHandle oh, const PhysXRoadGeometryQueryParams& ah, OmniPvdWriter* omniWriter, OmniPvdContextHandle ch);
920
922//VEHICLE
924
925struct Vehicle
926{
927 OmniPvdClassHandle CH;
928
929 OmniPvdAttributeHandle rigidBodyParamsAH;
930 OmniPvdAttributeHandle rigidBodyStateAH;
931
932 OmniPvdAttributeHandle suspStateCalcParamsAH;
933
934 OmniPvdAttributeHandle brakeResponseParamsSetAH;
935 OmniPvdAttributeHandle steerResponseParamsAH;
936 OmniPvdAttributeHandle brakeResponseStatesAH;
937 OmniPvdAttributeHandle steerResponseStatesAH;
938
939 OmniPvdAttributeHandle wheelAttachmentSetAH;
940
941 OmniPvdAttributeHandle antiRollSetAH;
942 OmniPvdAttributeHandle antiRollForceAH;
943
944 OmniPvdAttributeHandle directDrivetrainAH;
945 OmniPvdAttributeHandle engineDriveTrainAH;
946
947 OmniPvdAttributeHandle physxWheelAttachmentSetAH;
948
949 OmniPvdAttributeHandle physxRoadGeometryQueryParamsAH;
950 OmniPvdAttributeHandle physxRigidActorAH;
951};
952
953Vehicle registerVehicle(OmniPvdWriter* omniWriter);
954
955
956#if !PX_DOXYGEN
957} // namespace vehicle2
958} // namespace physx
959#endif
960
961#endif //PX_SUPPORT_OMNI_PVD
962
Used to write debug information to an OmniPvdWriteStream.
Definition OmniPvdWriter.h:47
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39