RavEngine
Loading...
Searching...
No Matches
PxVehicleUtilControl.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#ifndef PX_VEHICLE_UTIL_CONTROL_H
30#define PX_VEHICLE_UTIL_CONTROL_H
31
32#include "vehicle/PxVehicleSDK.h"
33#include "vehicle/PxVehicleDrive4W.h"
34#include "vehicle/PxVehicleDriveNW.h"
35#include "vehicle/PxVehicleDriveTank.h"
36
37
38#if !PX_DOXYGEN
39namespace physx
40{
41#endif
42
43#if PX_CHECKED
44 void testValidAnalogValue(const PxF32 actualValue, const PxF32 minVal, const PxF32 maxVal, const char* errorString);
45#endif
46
52{
53 PxVehicleSteerFilter(float sharpness=0.0f) : mSharpness(sharpness), mFilteredMaxSteer(0.0f) {}
54
55 static PX_FORCE_INLINE float feedbackFilter(float val, float& memory, float sharpness)
56 {
57 if(sharpness<0.0f) sharpness = 0.0f;
58 else if(sharpness>1.0f) sharpness = 1.0f;
59 return memory = val * sharpness + memory * (1.0f - sharpness);
60 }
61
62 PX_FORCE_INLINE float computeMaxSteer(const bool isVehicleInAir, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
63 const PxF32 vzAbs, const PxF32 timestep) const
64 {
65 const PxF32 targetMaxSteer = (isVehicleInAir ? 1.0f : steerVsForwardSpeedTable.getYVal(vzAbs));
66 if(mSharpness==0.0f)
67 return targetMaxSteer;
68 else
69 return feedbackFilter(targetMaxSteer, mFilteredMaxSteer, mSharpness*timestep);
70 }
71
72 PxReal mSharpness;
73 mutable PxReal mFilteredMaxSteer;
74};
75
81{
85 PxReal mRiseRates[PxVehicleDriveDynData::eMAX_NB_ANALOG_INPUTS];
86
90 PxReal mFallRates[PxVehicleDriveDynData::eMAX_NB_ANALOG_INPUTS];
91};
93
99{
103 PxReal mRiseRates[PxVehicleDriveDynData::eMAX_NB_ANALOG_INPUTS];
104
108 PxReal mFallRates[PxVehicleDriveDynData::eMAX_NB_ANALOG_INPUTS];
109};
111
117{
118public:
119
121 {
122 for(PxU32 i=0;i<PxVehicleDrive4WControl::eMAX_NB_DRIVE4W_ANALOG_INPUTS;i++)
123 {
124 mRawDigitalInputs[i]=false;
125 mRawAnalogInputs[i]=0.0f;
126 }
127
128 mGearUp = false;
129 mGearDown = false;
130 }
131
133 {
134 }
135
140 void setDigitalAccel(const bool accelKeyPressed) {mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_ACCEL]=accelKeyPressed;}
141
146 void setDigitalBrake(const bool brakeKeyPressed) {mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_BRAKE]=brakeKeyPressed;}
147
152 void setDigitalHandbrake(const bool handbrakeKeyPressed) {mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_HANDBRAKE]=handbrakeKeyPressed;}
153
158 void setDigitalSteerLeft(const bool steerLeftKeyPressed) {mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_STEER_LEFT]=steerLeftKeyPressed;}
159
164 void setDigitalSteerRight(const bool steerRightKeyPressed) {mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_STEER_RIGHT]=steerRightKeyPressed;}
165
166
171 bool getDigitalAccel() const {return mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_ACCEL];}
172
177 bool getDigitalBrake() const {return mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_BRAKE];}
178
183 bool getDigitalHandbrake() const {return mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_HANDBRAKE];}
184
189 bool getDigitalSteerLeft() const {return mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_STEER_LEFT];}
190
195 bool getDigitalSteerRight() const {return mRawDigitalInputs[PxVehicleDrive4WControl::eANALOG_INPUT_STEER_RIGHT];}
196
197
202 void setAnalogAccel(const PxReal accel)
203 {
204#if PX_CHECKED
205 testValidAnalogValue(accel, 0.0f, 1.0f, "Analog accel must be in range (0,1)");
206#endif
207 mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_ACCEL]=accel;
208 }
209
214 void setAnalogBrake(const PxReal brake)
215 {
216#if PX_CHECKED
217 testValidAnalogValue(brake, 0.0f, 1.0f, "Analog brake must be in range (0,1)");
218#endif
219 mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_BRAKE]=brake;
220 }
221
226 void setAnalogHandbrake(const PxReal handbrake)
227 {
228#if PX_CHECKED
229 testValidAnalogValue(handbrake, 0.0f, 1.0f, "Analog handbrake must be in range (0,1)");
230#endif
231 mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_HANDBRAKE]=handbrake;
232 }
233
238 void setAnalogSteer(const PxReal steer)
239 {
240#if PX_CHECKED
241 testValidAnalogValue(steer, -1.0f, 1.0f, "Analog steer must be in range (-1,1)");
242#endif
243 mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_STEER_RIGHT]=steer;
244 }
245
250 PxReal getAnalogAccel() const {return mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_ACCEL];}
251
256 PxReal getAnalogBrake() const {return mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_BRAKE];}
257
262 PxReal getAnalogHandbrake() const {return mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_HANDBRAKE];}
263
267 PxReal getAnalogSteer() const {return mRawAnalogInputs[PxVehicleDrive4WControl::eANALOG_INPUT_STEER_RIGHT];}
268
273 void setGearUp(const bool gearUpKeyPressed) {mGearUp=gearUpKeyPressed;}
274
279 void setGearDown(const bool gearDownKeyPressed) {mGearDown=gearDownKeyPressed;}
280
285 bool getGearUp() const {return mGearUp;}
286
291 bool getGearDown() const {return mGearDown;}
292
293private:
294
295 bool mRawDigitalInputs[PxVehicleDrive4WControl::eMAX_NB_DRIVE4W_ANALOG_INPUTS];
296 PxReal mRawAnalogInputs[PxVehicleDrive4WControl::eMAX_NB_DRIVE4W_ANALOG_INPUTS];
297
298 bool mGearUp;
299 bool mGearDown;
300};
301
315 (const PxVehicleKeySmoothingData& keySmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
316 const PxVehicleDrive4WRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
317 PxVehicleDrive4W& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
318 const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
319
333 (const PxVehiclePadSmoothingData& padSmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
334 const PxVehicleDrive4WRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
335 PxVehicleDrive4W& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
336 const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
337
338
350
364 (const PxVehicleKeySmoothingData& keySmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
365 const PxVehicleDriveNWRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
366 PxVehicleDriveNW& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
367 const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
368
382 (const PxVehiclePadSmoothingData& padSmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
383 const PxVehicleDriveNWRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
384 PxVehicleDriveNW& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
385 const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
386
387
393{
394public:
395
396 PxVehicleDriveTankRawInputData(const PxVehicleDriveTankControlModel::Enum mode)
397 : mMode(mode)
398 {
399 for(PxU32 i=0;i<PxVehicleDriveTankControl::eMAX_NB_DRIVETANK_ANALOG_INPUTS;i++)
400 {
401 mRawAnalogInputs[i]=0.0f;
402 mRawDigitalInputs[i]=false;
403 }
404
405 mGearUp=false;
406 mGearDown=false;
407 }
408
410 {
411 }
412
417 PxVehicleDriveTankControlModel::Enum getDriveModel() const
418 {
419 return mMode;
420 }
421
426 void setDigitalAccel(const bool b) {mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL]=b;}
427
432 void setDigitalLeftThrust(const bool b) {mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT]=b;}
433
438 void setDigitalRightThrust(const bool b) {mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT]=b;}
439
444 void setDigitalLeftBrake(const bool b) {mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT]=b;}
445
450 void setDigitalRightBrake(const bool b) {mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT]=b;}
451
456 bool getDigitalAccel() const {return mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL];}
457
462 bool getDigitalLeftThrust() const {return mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT];}
463
468 bool getDigitalRightThrust() const {return mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT];}
469
474 bool getDigitalLeftBrake() const {return mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT];}
475
480 bool getDigitalRightBrake() const {return mRawDigitalInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT];}
481
482
488 void setAnalogAccel(const PxF32 accel)
489 {
490#if PX_CHECKED
491 testValidAnalogValue(accel, 0.0f, 1.0f, "Tank analog accel must be in range (-1,1)");
492#endif
493 mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL]=accel;
494 }
495
501 void setAnalogLeftThrust(const PxF32 leftThrust)
502 {
503#if PX_CHECKED
504 if(mMode == PxVehicleDriveTankControlModel::eSPECIAL)
505 {
506 testValidAnalogValue(leftThrust, -1.0f, 1.0f, "Tank left thrust must be in range (-1,1) in eSPECIAL mode.");
507 }
508 else
509 {
510 testValidAnalogValue(leftThrust, 0.0f, 1.0f, "Tank left thrust must be in range (0,1) in eSTANDARD mode.");
511 }
512#endif
513 mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT]=leftThrust;
514 }
515
521 void setAnalogRightThrust(const PxF32 rightThrust)
522 {
523#if PX_CHECKED
524 if(mMode == PxVehicleDriveTankControlModel::eSPECIAL)
525 {
526 testValidAnalogValue(rightThrust, -1.0f, 1.0f, "Tank right thrust must be in range (-1,1) in eSPECIAL mode.");
527 }
528 else
529 {
530 testValidAnalogValue(rightThrust, 0.0f, 1.0f, "Tank right thrust must be in range (0,1) in eSTANDARD mode.");
531 }
532#endif
533 mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT]=rightThrust;
534 }
535
541 void setAnalogLeftBrake(const PxF32 leftBrake)
542 {
543#if PX_CHECKED
544 testValidAnalogValue(leftBrake, 0.0f, 1.0f, "Tank left brake must be in range (0,1).");
545#endif
546 mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT]=leftBrake;
547 }
548
554 void setAnalogRightBrake(const PxF32 rightBrake)
555 {
556#if PX_CHECKED
557 testValidAnalogValue(rightBrake, 0.0f, 1.0f, "Tank right brake must be in range (0,1).");
558#endif
559 mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT]=rightBrake;
560 }
561
566 PxF32 getAnalogAccel() const
567 {
568 return mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL];
569 }
570
575 PxF32 getAnalogLeftThrust() const
576 {
577 return mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT];
578 }
579
584 PxF32 getAnalogRightThrust() const
585 {
586 return mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT];
587 }
588
593 PxF32 getAnalogLeftBrake() const
594 {
595 return mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT];
596 }
597
602 PxF32 getAnalogRightBrake() const
603 {
604 return mRawAnalogInputs[PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT];
605 }
606
611 void setGearUp(const bool gearUp) {mGearUp=gearUp;}
612
617 void setGearDown(const bool gearDown) {mGearDown=gearDown;}
618
623 bool getGearUp() const {return mGearUp;}
624
629 bool getGearDown() const {return mGearDown;}
630
631private:
632
633 PxVehicleDriveTankControlModel::Enum mMode;
634
635 PxReal mRawAnalogInputs[PxVehicleDriveTankControl::eMAX_NB_DRIVETANK_ANALOG_INPUTS];
636 bool mRawDigitalInputs[PxVehicleDriveTankControl::eMAX_NB_DRIVETANK_ANALOG_INPUTS];
637
638 bool mGearUp;
639 bool mGearDown;
640};
641
651(const PxVehicleKeySmoothingData& keySmoothing,
652 const PxVehicleDriveTankRawInputData& rawInputData,
653 const PxReal timestep,
654 PxVehicleDriveTank& focusVehicle);
655
656
666(const PxVehiclePadSmoothingData& padSmoothing,
667 const PxVehicleDriveTankRawInputData& rawInputData,
668 const PxReal timestep,
669 PxVehicleDriveTank& focusVehicle);
670
671
672#if !PX_DOXYGEN
673} // namespace physx
674#endif
675
676#endif
Definition PxCoreUtilityTypes.h:113
3 Element vector class.
Definition PxVec3.h:50
Used to produce smooth vehicle driving control values from analog and digital inputs.
Definition PxVehicleUtilControl.h:117
PxReal getAnalogBrake() const
Return the analog brake value from the gamepad.
Definition PxVehicleUtilControl.h:256
bool getDigitalBrake() const
Return if the brake button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:177
bool getDigitalSteerRight() const
Return if the right steer button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:195
bool getDigitalHandbrake() const
Return if the handbrake button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:183
bool getDigitalSteerLeft() const
Return if the left steer button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:189
void setGearUp(const bool gearUpKeyPressed)
Record if the gearup button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:273
void setAnalogHandbrake(const PxReal handbrake)
Set the analog handbrake value from the gamepad.
Definition PxVehicleUtilControl.h:226
void setDigitalSteerRight(const bool steerRightKeyPressed)
Record if the right steer button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:164
void setAnalogSteer(const PxReal steer)
Set the analog steer value from the gamepad.
Definition PxVehicleUtilControl.h:238
void setDigitalAccel(const bool accelKeyPressed)
Record if the accel button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:140
void setDigitalSteerLeft(const bool steerLeftKeyPressed)
Record if the left steer button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:158
bool getGearUp() const
Return if the gearup button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:285
void setAnalogBrake(const PxReal brake)
Set the analog brake value from the gamepad.
Definition PxVehicleUtilControl.h:214
bool getDigitalAccel() const
Return if the accel button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:171
PxReal getAnalogAccel() const
Return the analog accel value from the gamepad.
Definition PxVehicleUtilControl.h:250
PxReal getAnalogHandbrake() const
Return the analog handbrake value from the gamepad.
Definition PxVehicleUtilControl.h:262
void setAnalogAccel(const PxReal accel)
Set the analog accel value from the gamepad.
Definition PxVehicleUtilControl.h:202
PxReal getAnalogSteer() const
Return the analog steer value from the gamepad.
Definition PxVehicleUtilControl.h:267
void setDigitalHandbrake(const bool handbrakeKeyPressed)
Record if the handbrake button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:152
void setGearDown(const bool gearDownKeyPressed)
Record if the geardown button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:279
bool getGearDown() const
Record if the geardown button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:291
void setDigitalBrake(const bool brakeKeyPressed)
Record if the brake button has been pressed on keyboard.
Definition PxVehicleUtilControl.h:146
Used to produce smooth vehicle driving control values from analog and digital inputs.
Definition PxVehicleUtilControl.h:344
Data structure with instanced dynamics data and configuration data of a vehicle with up to PX_MAX_NB_...
Definition PxVehicleDriveNW.h:131
Used to produce smooth analog tank control values from analog and digital inputs.
Definition PxVehicleUtilControl.h:393
void setDigitalAccel(const bool b)
Set if the accel button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:426
void setAnalogLeftBrake(const PxF32 leftBrake)
Set the analog left brake value from the gamepad.
Definition PxVehicleUtilControl.h:541
PxF32 getAnalogAccel() const
Return the analog accel value from the gamepad.
Definition PxVehicleUtilControl.h:566
void setGearDown(const bool gearDown)
Record if the gear-down button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:617
bool getGearDown() const
Return if the gear-down button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:629
void setAnalogAccel(const PxF32 accel)
Set the analog accel value from the gamepad
Definition PxVehicleUtilControl.h:488
bool getDigitalRightBrake() const
Return if the right brake button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:480
PxF32 getAnalogRightThrust() const
Return the analog right thrust value from the gamepad.
Definition PxVehicleUtilControl.h:584
void setDigitalRightThrust(const bool b)
Set if the right thrust button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:438
void setDigitalRightBrake(const bool b)
Set if the right brake button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:450
void setDigitalLeftBrake(const bool b)
Set if the left brake button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:444
bool getDigitalAccel() const
Return if the accel button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:456
void setDigitalLeftThrust(const bool b)
Set if the left thrust button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:432
bool getDigitalLeftBrake() const
Return if the left brake button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:474
PxF32 getAnalogLeftBrake() const
Return the analog left brake value from the gamepad.
Definition PxVehicleUtilControl.h:593
void setGearUp(const bool gearUp)
Record if the gear-up button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:611
void setAnalogLeftThrust(const PxF32 leftThrust)
Set the analog left thrust value from the gamepad.
Definition PxVehicleUtilControl.h:501
void setAnalogRightBrake(const PxF32 rightBrake)
Set the analog right brake value from the gamepad
Definition PxVehicleUtilControl.h:554
bool getDigitalLeftThrust() const
Return if the left thrust button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:462
PxVehicleDriveTankControlModel::Enum getDriveModel() const
Return the drive model (eDRIVE_MODEL_SPECIAL or eDRIVE_MODEL_STANDARD)
Definition PxVehicleUtilControl.h:417
bool getGearUp() const
Return if the gear-up button has been pressed on keyboard or gamepad.
Definition PxVehicleUtilControl.h:623
void setAnalogRightThrust(const PxF32 rightThrust)
Set the analog right thrust value from the gamepad.
Definition PxVehicleUtilControl.h:521
PxF32 getAnalogRightBrake() const
Return the analog right brake value from the gamepad.
Definition PxVehicleUtilControl.h:602
bool getDigitalRightThrust() const
Return if the right thrust button has been pressed on the keyboard.
Definition PxVehicleUtilControl.h:468
PxF32 getAnalogLeftThrust() const
Return the analog left thrust value from the gamepad.
Definition PxVehicleUtilControl.h:575
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
#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_DEPRECATED void PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs(const PxVehicleKeySmoothingData &keySmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDrive4WRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDrive4W &focusVehicle, const PxVehicleSteerFilter &steerFilter=PxVehicleSteerFilter(), const PxVec3 &forwardAxis=PxVehicleGetDefaultContext().forwardAxis)
Used to smooth and set analog vehicle control values (accel,brake,handbrake,steer) from digital input...
Definition VehicleUtilControl.cpp:245
PX_DEPRECATED void PxVehicleDriveNWSmoothDigitalRawInputsAndSetAnalogInputs(const PxVehicleKeySmoothingData &keySmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDriveNWRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDriveNW &focusVehicle, const PxVehicleSteerFilter &steerFilter=PxVehicleSteerFilter(), const PxVec3 &forwardAxis=PxVehicleGetDefaultContext().forwardAxis)
Used to smooth and set analog vehicle control values (accel,brake,handbrake,steer) from digital input...
Definition VehicleUtilControl.cpp:267
PX_DEPRECATED void PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs(const PxVehiclePadSmoothingData &padSmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDrive4WRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDrive4W &focusVehicle, const PxVehicleSteerFilter &steerFilter=PxVehicleSteerFilter(), const PxVec3 &forwardAxis=PxVehicleGetDefaultContext().forwardAxis)
Used to smooth and set analog vehicle control values from analog inputs (gamepad)....
Definition VehicleUtilControl.cpp:255
PX_DEPRECATED void PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs(const PxVehicleKeySmoothingData &keySmoothing, const PxVehicleDriveTankRawInputData &rawInputData, const PxReal timestep, PxVehicleDriveTank &focusVehicle)
Used to smooth and set analog tank control values from digital inputs (keyboard). Also used to set bo...
Definition VehicleUtilControl.cpp:402
PX_DEPRECATED const PxVehicleContext & PxVehicleGetDefaultContext()
Get the default vehicle context.
Definition PxVehicleUpdate.cpp:120
PX_DEPRECATED void PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs(const PxVehiclePadSmoothingData &padSmoothing, const PxVehicleDriveTankRawInputData &rawInputData, const PxReal timestep, PxVehicleDriveTank &focusVehicle)
Used to smooth and set analog tank control values from analog inputs (gamepad). Also used to set bool...
Definition VehicleUtilControl.cpp:289
PX_DEPRECATED void PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs(const PxVehiclePadSmoothingData &padSmoothing, const PxFixedSizeLookupTable< 8 > &steerVsForwardSpeedTable, const PxVehicleDriveNWRawInputData &rawInputData, const PxReal timestep, const bool isVehicleInAir, PxVehicleDriveNW &focusVehicle, const PxVehicleSteerFilter &steerFilter=PxVehicleSteerFilter(), const PxVec3 &forwardAxis=PxVehicleGetDefaultContext().forwardAxis)
Used to smooth and set analog vehicle control values from analog inputs (gamepad)....
Definition VehicleUtilControl.cpp:277
Used to produce smooth vehicle driving control values from key inputs.
Definition PxVehicleUtilControl.h:81
Used to produce smooth analog vehicle control values from analog inputs.
Definition PxVehicleUtilControl.h:99
Used to produce smooth steering values in the presence of discontinuities when a vehicle e....
Definition PxVehicleUtilControl.h:52