Upgrade to PhysX 5.1.3
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_CORE_COMPONENTS_H
|
||||
#define PX_VEHICLE_CORE_COMPONENTS_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
#ifndef PX_VEHICLE_COMPONENTS_H
|
||||
#define PX_VEHICLE_COMPONENTS_H
|
||||
|
||||
#include "foundation/PxMemory.h"
|
||||
#include "foundation/PxVec3.h"
|
||||
@@ -44,7 +40,7 @@ namespace physx
|
||||
{
|
||||
#endif
|
||||
|
||||
class PxVehicleChassisData
|
||||
class PX_DEPRECATED PxVehicleChassisData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -86,7 +82,7 @@ private:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleChassisData)& 0x0f));
|
||||
|
||||
class PxVehicleEngineData
|
||||
class PX_DEPRECATED PxVehicleEngineData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -239,7 +235,7 @@ public:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleEngineData)& 0x0f));
|
||||
|
||||
class PxVehicleGearsData
|
||||
class PX_DEPRECATED PxVehicleGearsData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -344,7 +340,7 @@ public:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleGearsData)& 0x0f));
|
||||
|
||||
class PxVehicleAutoBoxData
|
||||
class PX_DEPRECATED PxVehicleAutoBoxData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -427,7 +423,7 @@ public:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleAutoBoxData)& 0x0f));
|
||||
|
||||
class PxVehicleDifferential4WData
|
||||
class PX_DEPRECATED PxVehicleDifferential4WData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -532,7 +528,7 @@ public:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDifferential4WData)& 0x0f));
|
||||
|
||||
class PxVehicleDifferentialNWData
|
||||
class PX_DEPRECATED PxVehicleDifferentialNWData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -579,7 +575,7 @@ public:
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDifferentialNWData)& 0x0f));
|
||||
|
||||
|
||||
class PxVehicleAckermannGeometryData
|
||||
class PX_DEPRECATED PxVehicleAckermannGeometryData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -652,7 +648,7 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleAckermannGeometryData)& 0x0f));
|
||||
\brief Choose between a potentially more expensive but more accurate solution to the clutch model or a potentially cheaper but less accurate solution.
|
||||
@see PxVehicleClutchData
|
||||
*/
|
||||
struct PxVehicleClutchAccuracyMode
|
||||
struct PX_DEPRECATED PxVehicleClutchAccuracyMode
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -661,7 +657,7 @@ struct PxVehicleClutchAccuracyMode
|
||||
};
|
||||
};
|
||||
|
||||
class PxVehicleClutchData
|
||||
class PX_DEPRECATED PxVehicleClutchData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -759,7 +755,7 @@ to give less jerky handling behavior.
|
||||
|
||||
\note The tire load applied as input to the tire force computation is the filtered normalized load multiplied by the rest load.
|
||||
*/
|
||||
class PxVehicleTireLoadFilterData
|
||||
class PX_DEPRECATED PxVehicleTireLoadFilterData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -815,7 +811,7 @@ public:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleTireLoadFilterData)& 0x0f));
|
||||
|
||||
class PxVehicleWheelData
|
||||
class PX_DEPRECATED PxVehicleWheelData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -957,7 +953,7 @@ private:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleWheelData)& 0x0f));
|
||||
|
||||
class PxVehicleSuspensionData
|
||||
class PX_DEPRECATED PxVehicleSuspensionData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1023,7 +1019,8 @@ public:
|
||||
|
||||
\note The sum of the sprung masses of all suspensions of a vehicle should match the mass of the PxRigidDynamic associated with the vehicle.
|
||||
When this condition is satisfied for a vehicle on a horizontal plane the wheels of the vehicle are guaranteed to sit at the rest pose
|
||||
defined by the wheel centre offset. The mass matching condition is not enforced.
|
||||
defined by the wheel centre offset. For special cases, where this condition can not be met easily, the flag
|
||||
#PxVehicleWheelsSimFlag::eDISABLE_SPRUNG_MASS_SUM_CHECK allows to provide sprung mass values that do not sum up to the mass of the PxRigidDynamic.
|
||||
|
||||
\note As the wheel compresses or elongates along the suspension direction the force generated by the spring is
|
||||
F = |gravity|*mSprungMass + deltaX*mSpringStrength + deltaXDot*mSpringDamperRate
|
||||
@@ -1135,7 +1132,7 @@ private:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleSuspensionData)& 0x0f));
|
||||
|
||||
class PxVehicleAntiRollBarData
|
||||
class PX_DEPRECATED PxVehicleAntiRollBarData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1175,7 +1172,7 @@ private:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleAntiRollBarData)& 0x0f));
|
||||
|
||||
class PxVehicleTireData
|
||||
class PX_DEPRECATED PxVehicleTireData
|
||||
{
|
||||
public:
|
||||
friend class PxVehicleWheels4SimData;
|
||||
@@ -1355,5 +1352,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleTireData)& 0x0f));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_CORE_COMPONENTS_H
|
||||
#endif
|
||||
|
||||
17
Source/ThirdParty/PhysX/vehicle/PxVehicleDrive.h
vendored
17
Source/ThirdParty/PhysX/vehicle/PxVehicleDrive.h
vendored
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_DRIVE_H
|
||||
#define PX_VEHICLE_DRIVE_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "vehicle/PxVehicleWheels.h"
|
||||
#include "vehicle/PxVehicleComponents.h"
|
||||
@@ -53,7 +49,7 @@ class PxRigidDynamic;
|
||||
\brief Data structure describing non-wheel configuration data of a vehicle that has engine, gears, clutch, and auto-box.
|
||||
@see PxVehicleWheelsSimData for wheels configuration data.
|
||||
*/
|
||||
class PxVehicleDriveSimData
|
||||
class PX_DEPRECATED PxVehicleDriveSimData
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -168,7 +164,7 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveSimData) & 15));
|
||||
\brief Data structure with instanced dynamics data for vehicle with engine, clutch, gears, autobox
|
||||
@see PxVehicleWheelsDynData for wheels dynamics data.
|
||||
*/
|
||||
class PxVehicleDriveDynData
|
||||
class PX_DEPRECATED PxVehicleDriveDynData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -493,7 +489,7 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveDynData) & 15));
|
||||
\brief A complete vehicle with instance dynamics data and configuration data for wheels and engine,clutch,gears,autobox.
|
||||
@see PxVehicleDrive4W, PxVehicleDriveTank
|
||||
*/
|
||||
class PxVehicleDrive : public PxVehicleWheels
|
||||
class PX_DEPRECATED PxVehicleDrive : public PxVehicleWheels
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -561,5 +557,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDrive) & 15));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_DRIVE_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_4WDRIVE_H
|
||||
#define PX_VEHICLE_4WDRIVE_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "vehicle/PxVehicleDrive.h"
|
||||
#include "vehicle/PxVehicleWheels.h"
|
||||
@@ -56,7 +52,7 @@ class PxRigidDynamic;
|
||||
The drive model incorporates engine, clutch, gears, autobox, differential, and Ackermann steer correction.
|
||||
@see PxVehicleDriveSimData
|
||||
*/
|
||||
class PxVehicleDriveSimData4W : public PxVehicleDriveSimData
|
||||
class PX_DEPRECATED PxVehicleDriveSimData4W : public PxVehicleDriveSimData
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -140,7 +136,7 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveSimData4W) & 15));
|
||||
@see PxVehicleWheelsSimData, PxVehicleWheelsDynData
|
||||
*/
|
||||
|
||||
struct PxVehicleDrive4WWheelOrder
|
||||
struct PX_DEPRECATED PxVehicleDrive4WWheelOrder
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -157,7 +153,7 @@ struct PxVehicleDrive4WWheelOrder
|
||||
@see PxVehicleDriveDynData::setAnalogInput, PxVehicleDriveDynData::getAnalogInput
|
||||
*/
|
||||
|
||||
struct PxVehicleDrive4WControl
|
||||
struct PX_DEPRECATED PxVehicleDrive4WControl
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -173,7 +169,7 @@ struct PxVehicleDrive4WControl
|
||||
/**
|
||||
\brief Data structure with instanced dynamics data and configuration data of a vehicle with up to 4 driven wheels and up to 16 non-driven wheels.
|
||||
*/
|
||||
class PxVehicleDrive4W : public PxVehicleDrive
|
||||
class PX_DEPRECATED PxVehicleDrive4W : public PxVehicleDrive
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -274,5 +270,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDrive4W) & 15));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_4WDRIVE_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_NWDRIVE_H
|
||||
#define PX_VEHICLE_NWDRIVE_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "vehicle/PxVehicleDrive.h"
|
||||
#include "vehicle/PxVehicleWheels.h"
|
||||
@@ -55,7 +51,7 @@ class PxRigidDynamic;
|
||||
engine, clutch, gears, autobox, differential.
|
||||
@see PxVehicleDriveSimData
|
||||
*/
|
||||
class PxVehicleDriveSimDataNW : public PxVehicleDriveSimData
|
||||
class PX_DEPRECATED PxVehicleDriveSimDataNW : public PxVehicleDriveSimData
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -115,7 +111,7 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveSimDataNW) & 15));
|
||||
|
||||
@see PxVehicleDriveDynData::setAnalogInput, PxVehicleDriveDynData::getAnalogInput
|
||||
*/
|
||||
struct PxVehicleDriveNWControl
|
||||
struct PX_DEPRECATED PxVehicleDriveNWControl
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -131,7 +127,7 @@ struct PxVehicleDriveNWControl
|
||||
/**
|
||||
\brief Data structure with instanced dynamics data and configuration data of a vehicle with up to PX_MAX_NB_WHEELS driven wheels.
|
||||
*/
|
||||
class PxVehicleDriveNW : public PxVehicleDrive
|
||||
class PX_DEPRECATED PxVehicleDriveNW : public PxVehicleDrive
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -232,5 +228,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveNW) & 15));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_NWDRIVE_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_DRIVE_TANK_H
|
||||
#define PX_VEHICLE_DRIVE_TANK_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "vehicle/PxVehicleDrive.h"
|
||||
#include "vehicle/PxVehicleWheels.h"
|
||||
@@ -56,7 +52,7 @@ class PxRigidDynamic;
|
||||
|
||||
@see PxVehicleWheelsSimData, PxVehicleWheelsDynData
|
||||
*/
|
||||
struct PxVehicleDriveTankWheelOrder
|
||||
struct PX_DEPRECATED PxVehicleDriveTankWheelOrder
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -102,7 +98,7 @@ the tank will turn to the left.
|
||||
@see PxVehicleDriveDynData::setAnalogInput, PxVehicleDriveDynData::getAnalogInput
|
||||
*/
|
||||
|
||||
struct PxVehicleDriveTankControl
|
||||
struct PX_DEPRECATED PxVehicleDriveTankControl
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -134,7 +130,7 @@ thrust to the right wheels.
|
||||
|
||||
@see PxVehicleDriveTank::setDriveModel
|
||||
*/
|
||||
struct PxVehicleDriveTankControlModel
|
||||
struct PX_DEPRECATED PxVehicleDriveTankControlModel
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -147,7 +143,7 @@ struct PxVehicleDriveTankControlModel
|
||||
/**
|
||||
\brief Data structure with instanced dynamics data and configuration data of a tank.
|
||||
*/
|
||||
class PxVehicleDriveTank : public PxVehicleDrive
|
||||
class PX_DEPRECATED PxVehicleDriveTank : public PxVehicleDrive
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -276,5 +272,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveTank) & 15));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_DRIVE_TANK_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_NO_DRIVE_H
|
||||
#define PX_VEHICLE_NO_DRIVE_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "vehicle/PxVehicleWheels.h"
|
||||
#include "vehicle/PxVehicleComponents.h"
|
||||
@@ -53,7 +49,7 @@ class PxRigidDynamic;
|
||||
/**
|
||||
\brief Data structure with instanced dynamics data and configuration data of a vehicle with no drive model.
|
||||
*/
|
||||
class PxVehicleNoDrive : public PxVehicleWheels
|
||||
class PX_DEPRECATED PxVehicleNoDrive : public PxVehicleWheels
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -212,5 +208,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleNoDrive) & 15));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_NO_DRIVE_H
|
||||
#endif
|
||||
|
||||
231
Source/ThirdParty/PhysX/vehicle/PxVehicleSDK.h
vendored
231
Source/ThirdParty/PhysX/vehicle/PxVehicleSDK.h
vendored
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,17 +22,15 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_SDK_H
|
||||
#define PX_VEHICLE_SDK_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "foundation/Px.h"
|
||||
#include "foundation/PxVec3.h"
|
||||
#include "common/PxTypeInfo.h"
|
||||
|
||||
#if !PX_DOXYGEN
|
||||
@@ -57,7 +54,7 @@ Call this before using any of the vehicle functions.
|
||||
|
||||
@see PxCloseVehicleSDK
|
||||
*/
|
||||
PX_C_EXPORT bool PX_CALL_CONV PxInitVehicleSDK(PxPhysics& physics, PxSerializationRegistry* serializationRegistry = NULL);
|
||||
PX_DEPRECATED PX_C_EXPORT bool PX_CALL_CONV PxInitVehicleSDK(PxPhysics& physics, PxSerializationRegistry* serializationRegistry = NULL);
|
||||
|
||||
|
||||
/**
|
||||
@@ -72,7 +69,7 @@ Call this function as part of the physx shutdown process.
|
||||
|
||||
@see PxInitVehicleSDK
|
||||
*/
|
||||
PX_C_EXPORT void PX_CALL_CONV PxCloseVehicleSDK(PxSerializationRegistry* serializationRegistry = NULL);
|
||||
PX_DEPRECATED PX_C_EXPORT void PX_CALL_CONV PxCloseVehicleSDK(PxSerializationRegistry* serializationRegistry = NULL);
|
||||
|
||||
|
||||
/**
|
||||
@@ -92,7 +89,7 @@ PX_C_EXPORT void PX_CALL_CONV PxCloseVehicleSDK(PxSerializationRegistry* seriali
|
||||
/**
|
||||
@see PxVehicleDrive4W, PxVehicleDriveTank, PxVehicleDriveNW, PxVehicleNoDrive, PxVehicleWheels::getVehicleType
|
||||
*/
|
||||
struct PxVehicleTypes
|
||||
struct PX_DEPRECATED PxVehicleTypes
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -113,7 +110,7 @@ struct PxVehicleTypes
|
||||
\note This enum can be used to identify a vehicle object stored in a PxCollection.
|
||||
@see PxBase, PxTypeInfo, PxBase::getConcreteType
|
||||
*/
|
||||
struct PxVehicleConcreteType
|
||||
struct PX_DEPRECATED PxVehicleConcreteType
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -128,17 +125,20 @@ struct PxVehicleConcreteType
|
||||
/**
|
||||
\brief Set the basis vectors of the vehicle simulation
|
||||
|
||||
Default values PxVec3(0,1,0), PxVec3(0,0,1)
|
||||
See PxVehicleContext for the default values.
|
||||
|
||||
Call this function before using PxVehicleUpdates unless the default values are correct.
|
||||
Call this function before using PxVehicleUpdates unless the default values are correct
|
||||
or the settings structure is explicitly provided.
|
||||
|
||||
@see PxVehicleContext
|
||||
*/
|
||||
void PxVehicleSetBasisVectors(const PxVec3& up, const PxVec3& forward);
|
||||
PX_DEPRECATED void PxVehicleSetBasisVectors(const PxVec3& up, const PxVec3& forward);
|
||||
|
||||
|
||||
/**
|
||||
@see PxVehicleSetUpdateMode
|
||||
*/
|
||||
struct PxVehicleUpdateMode
|
||||
struct PX_DEPRECATED PxVehicleUpdateMode
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -153,13 +153,14 @@ struct PxVehicleUpdateMode
|
||||
|
||||
with an acceleration to be applied in the next PhysX SDK update or as an immediate velocity modification.
|
||||
|
||||
Default behavior is immediate velocity modification.
|
||||
See PxVehicleContext for the default value.
|
||||
|
||||
Call this function before using PxVehicleUpdates for the first time if the default is not the desired behavior.
|
||||
Call this function before using PxVehicleUpdates for the first time if the default is not the desired behavior
|
||||
or if the settings structure is not explicitly provided.
|
||||
|
||||
@see PxVehicleUpdates
|
||||
@see PxVehicleUpdates, PxVehicleContext
|
||||
*/
|
||||
void PxVehicleSetUpdateMode(PxVehicleUpdateMode::Enum vehicleUpdateMode);
|
||||
PX_DEPRECATED void PxVehicleSetUpdateMode(PxVehicleUpdateMode::Enum vehicleUpdateMode);
|
||||
|
||||
/**
|
||||
|
||||
@@ -211,9 +212,9 @@ by the contact modification callback PxVehicleModifyWheelContacts.
|
||||
|
||||
\note Both angles have default values of Pi/4.
|
||||
|
||||
@see PxVehicleSuspensionSweeps, PxVehicleModifyWheelContacts
|
||||
@see PxVehicleSuspensionSweeps, PxVehicleModifyWheelContacts, PxVehicleContext
|
||||
*/
|
||||
void PxVehicleSetSweepHitRejectionAngles(const PxF32 pointRejectAngle, const PxF32 normalRejectAngle);
|
||||
PX_DEPRECATED void PxVehicleSetSweepHitRejectionAngles(const PxF32 pointRejectAngle, const PxF32 normalRejectAngle);
|
||||
|
||||
|
||||
/**
|
||||
@@ -225,13 +226,195 @@ the suspension must be applied to dynamic objects that lie under the wheel. This
|
||||
when a heavy wheel is driving on a light object. The value of maxHitActorAcceleration clamps the applied force so that it never
|
||||
generates an acceleration greater than the specified value.
|
||||
|
||||
\note Default value of maxHitActorAcceleration is PX_MAX_REAL
|
||||
See PxVehicleContext for the default value.
|
||||
|
||||
@see PxVehicleContext
|
||||
*/
|
||||
void PxVehicleSetMaxHitActorAcceleration(const PxF32 maxHitActorAcceleration);
|
||||
PX_DEPRECATED void PxVehicleSetMaxHitActorAcceleration(const PxF32 maxHitActorAcceleration);
|
||||
|
||||
|
||||
/**
|
||||
\brief Common parameters and settings used for the vehicle simulation.
|
||||
|
||||
To be passed into PxVehicleUpdates(), for example.
|
||||
|
||||
@see PxVehicleUpdates()
|
||||
*/
|
||||
class PX_DEPRECATED PxVehicleContext
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
\brief The axis denoting the up direction for vehicles.
|
||||
|
||||
<b>Range:</b> unit length vector<br>
|
||||
<b>Default:</b> PxVec3(0,1,0)
|
||||
|
||||
@see PxVehicleSetBasisVectors()
|
||||
*/
|
||||
PxVec3 upAxis;
|
||||
|
||||
/**
|
||||
\brief The axis denoting the forward direction for vehicles.
|
||||
|
||||
<b>Range:</b> unit length vector<br>
|
||||
<b>Default:</b> PxVec3(0,0,1)
|
||||
|
||||
@see PxVehicleSetBasisVectors()
|
||||
*/
|
||||
PxVec3 forwardAxis;
|
||||
|
||||
/**
|
||||
\brief The axis denoting the side direction for vehicles.
|
||||
|
||||
Has to be the cross product of the up- and forward-axis. The method
|
||||
computeSideAxis() can be used to do that computation for you.
|
||||
|
||||
<b>Range:</b> unit length vector<br>
|
||||
<b>Default:</b> PxVec3(1,0,0)
|
||||
|
||||
@see PxVehicleSetBasisVectors(), computeSideAxis()
|
||||
*/
|
||||
PxVec3 sideAxis;
|
||||
|
||||
/**
|
||||
\brief Apply vehicle simulation results as acceleration or velocity modification.
|
||||
|
||||
See PxVehicleSetUpdateMode() for details.
|
||||
|
||||
<b>Default:</b> eVELOCITY_CHANGE
|
||||
|
||||
@see PxVehicleSetUpdateMode()
|
||||
*/
|
||||
PxVehicleUpdateMode::Enum updateMode;
|
||||
|
||||
/**
|
||||
\brief Cosine of threshold angle for rejecting sweep hits.
|
||||
|
||||
See PxVehicleSetSweepHitRejectionAngles() for details.
|
||||
|
||||
<b>Range:</b> (1, -1)<br>
|
||||
<b>Default:</b> 0.707f (cosine of 45 degrees)
|
||||
|
||||
@see PxVehicleSetSweepHitRejectionAngles()
|
||||
*/
|
||||
PxF32 pointRejectAngleThresholdCosine;
|
||||
|
||||
/**
|
||||
\brief Cosine of threshold angle for rejecting sweep hits.
|
||||
|
||||
See PxVehicleSetSweepHitRejectionAngles() for details.
|
||||
|
||||
<b>Range:</b> (1, -1)<br>
|
||||
<b>Default:</b> 0.707f (cosine of 45 degrees)
|
||||
|
||||
@see PxVehicleSetSweepHitRejectionAngles()
|
||||
*/
|
||||
PxF32 normalRejectAngleThresholdCosine;
|
||||
|
||||
/**
|
||||
\brief Maximum acceleration experienced by PxRigidDynamic instances that are found to be in contact with a wheel.
|
||||
|
||||
See PxVehicleSetMaxHitActorAcceleration() for details.
|
||||
|
||||
<b>Range:</b> [0, PX_MAX_REAL]<br>
|
||||
<b>Default:</b> PX_MAX_REAL
|
||||
|
||||
@see PxVehicleSetMaxHitActorAcceleration()
|
||||
*/
|
||||
PxF32 maxHitActorAcceleration;
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
\brief Constructor sets to default.
|
||||
*/
|
||||
PX_INLINE PxVehicleContext();
|
||||
|
||||
/**
|
||||
\brief (re)sets the structure to the default.
|
||||
*/
|
||||
PX_INLINE void setToDefault();
|
||||
|
||||
/**
|
||||
\brief Check if the settings descriptor is valid.
|
||||
|
||||
\return True if the current settings are valid.
|
||||
*/
|
||||
PX_INLINE bool isValid() const;
|
||||
|
||||
/**
|
||||
\brief Compute the side-axis from the up- and forward-axis
|
||||
*/
|
||||
PX_INLINE void computeSideAxis();
|
||||
};
|
||||
|
||||
PX_INLINE PxVehicleContext::PxVehicleContext():
|
||||
upAxis(0.0f, 1.0f, 0.0f),
|
||||
forwardAxis(0.0f, 0.0f, 1.0f),
|
||||
sideAxis(1.0f, 0.0f, 0.0f),
|
||||
updateMode(PxVehicleUpdateMode::eVELOCITY_CHANGE),
|
||||
pointRejectAngleThresholdCosine(0.707f), // cosine of 45 degrees
|
||||
normalRejectAngleThresholdCosine(0.707f), // cosine of 45 degrees
|
||||
maxHitActorAcceleration(PX_MAX_REAL)
|
||||
{
|
||||
}
|
||||
|
||||
PX_INLINE void PxVehicleContext::setToDefault()
|
||||
{
|
||||
*this = PxVehicleContext();
|
||||
}
|
||||
|
||||
PX_INLINE bool PxVehicleContext::isValid() const
|
||||
{
|
||||
if (!upAxis.isNormalized())
|
||||
return false;
|
||||
|
||||
if (!forwardAxis.isNormalized())
|
||||
return false;
|
||||
|
||||
if (!sideAxis.isNormalized())
|
||||
return false;
|
||||
|
||||
if (((upAxis.cross(forwardAxis)) - sideAxis).magnitude() > 0.02f) // somewhat above 1 degree assuming both have unit length
|
||||
return false;
|
||||
|
||||
if ((pointRejectAngleThresholdCosine >= 1) || (pointRejectAngleThresholdCosine <= -1))
|
||||
return false;
|
||||
|
||||
if ((normalRejectAngleThresholdCosine >= 1) || (normalRejectAngleThresholdCosine <= -1))
|
||||
return false;
|
||||
|
||||
if (maxHitActorAcceleration < 0.0f)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PX_INLINE void PxVehicleContext::computeSideAxis()
|
||||
{
|
||||
sideAxis = upAxis.cross(forwardAxis);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get the default vehicle context.
|
||||
|
||||
Will be used if the corresponding parameters are not specified in methods like
|
||||
PxVehicleUpdates() etc.
|
||||
|
||||
To set the default values, see the methods PxVehicleSetBasisVectors(),
|
||||
PxVehicleSetUpdateMode() etc.
|
||||
|
||||
\return The default vehicle context.
|
||||
|
||||
@see PxVehicleSetBasisVectors() PxVehicleSetUpdateMode()
|
||||
*/
|
||||
PX_DEPRECATED const PxVehicleContext& PxVehicleGetDefaultContext();
|
||||
|
||||
|
||||
#if !PX_DOXYGEN
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_SDK_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_SHADERS_H
|
||||
#define PX_VEHICLE_SHADERS_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "foundation/PxSimpleTypes.h"
|
||||
|
||||
@@ -61,7 +57,7 @@ namespace physx
|
||||
\param[out] tireAlignMoment is the aligning moment of the tire that is to be applied to the vehicle's rigid body (not currently used).
|
||||
@see PxVehicleWheelsDynData::setTireForceShaderFunction, PxVehicleWheelsDynData::setTireForceShaderData
|
||||
*/
|
||||
typedef void (*PxVehicleComputeTireForce)
|
||||
PX_DEPRECATED typedef void (*PxVehicleComputeTireForce)
|
||||
(const void* shaderData,
|
||||
const PxF32 tireFriction,
|
||||
const PxF32 longSlip, const PxF32 latSlip, const PxF32 camber,
|
||||
@@ -75,5 +71,4 @@ typedef void (*PxVehicleComputeTireForce)
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_SHADERS_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,17 +22,15 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_TIREFRICTION_H
|
||||
#define PX_VEHICLE_TIREFRICTION_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "foundation/PxSimpleTypes.h"
|
||||
#include "common/PxSerialFramework.h"
|
||||
|
||||
#if !PX_DOXYGEN
|
||||
namespace physx
|
||||
@@ -41,12 +38,14 @@ namespace physx
|
||||
#endif
|
||||
|
||||
class PxMaterial;
|
||||
class PxCollection;
|
||||
class PxOutputStream;
|
||||
|
||||
/**
|
||||
\brief Driving surface type. Each PxMaterial is associated with a corresponding PxVehicleDrivableSurfaceType.
|
||||
@see PxMaterial, PxVehicleDrivableSurfaceToTireFrictionPairs
|
||||
*/
|
||||
struct PxVehicleDrivableSurfaceType
|
||||
struct PX_DEPRECATED PxVehicleDrivableSurfaceType
|
||||
{
|
||||
enum
|
||||
{
|
||||
@@ -59,7 +58,7 @@ struct PxVehicleDrivableSurfaceType
|
||||
\brief Friction for each combination of driving surface type and tire type.
|
||||
@see PxVehicleDrivableSurfaceType, PxVehicleTireData::mType
|
||||
*/
|
||||
class PxVehicleDrivableSurfaceToTireFrictionPairs
|
||||
class PX_DEPRECATED PxVehicleDrivableSurfaceToTireFrictionPairs
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -116,28 +115,83 @@ public:
|
||||
*/
|
||||
void setTypePairFriction(const PxU32 surfaceType, const PxU32 tireType, const PxReal value);
|
||||
|
||||
|
||||
/**
|
||||
\brief Compute the surface type associated with a specified PxMaterial instance.
|
||||
\param[in] surfaceMaterial is the material to be queried for its associated surface type.
|
||||
\note The surface type may be used to query the friction of a surface type/tire type pair using getTypePairFriction()
|
||||
\return The surface type associated with a specified PxMaterial instance.
|
||||
If surfaceMaterial is not referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs a value of 0 will be returned.
|
||||
@see setup
|
||||
@see getTypePairFriction
|
||||
*/
|
||||
PxU32 getSurfaceType(const PxMaterial& surfaceMaterial) const;
|
||||
|
||||
/**
|
||||
\brief Return the friction for a specified combination of surface type and tire type.
|
||||
\return The friction for a specified combination of surface type and tire type.
|
||||
\note The final friction value used by the tire model is the value returned by getTypePairFriction
|
||||
multiplied by the value computed from PxVehicleTireData::mFrictionVsSlipGraph
|
||||
\note The surface type is associated with a PxMaterial. The mapping between the two may be queried using getSurfaceType().
|
||||
@see PxVehicleTireData::mFrictionVsSlipGraph
|
||||
@see getSurfaceType
|
||||
*/
|
||||
PxReal getTypePairFriction(const PxU32 surfaceType, const PxU32 tireType) const;
|
||||
|
||||
/**
|
||||
\brief Return the friction for a specified combination of PxMaterial and tire type.
|
||||
\return The friction for a specified combination of PxMaterial and tire type.
|
||||
\note The final friction value used by the tire model is the value returned by getTypePairFriction
|
||||
multiplied by the value computed from PxVehicleTireData::mFrictionVsSlipGraph
|
||||
\note If surfaceMaterial is not referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs
|
||||
a surfaceType of value 0 will be assumed and the corresponding friction value will be returned.
|
||||
@see PxVehicleTireData::mFrictionVsSlipGraph
|
||||
*/
|
||||
PxReal getTypePairFriction(const PxMaterial& surfaceMaterial, const PxU32 tireType) const;
|
||||
|
||||
/**
|
||||
\brief Return the maximum number of surface types
|
||||
\return The maximum number of surface types
|
||||
@see allocate
|
||||
*/
|
||||
PxU32 getMaxNbSurfaceTypes() const {return mMaxNbSurfaceTypes;}
|
||||
PX_FORCE_INLINE PxU32 getMaxNbSurfaceTypes() const {return mMaxNbSurfaceTypes;}
|
||||
|
||||
/**
|
||||
\brief Return the maximum number of tire types
|
||||
\return The maximum number of tire types
|
||||
@see allocate
|
||||
*/
|
||||
PxU32 getMaxNbTireTypes() const {return mMaxNbTireTypes;}
|
||||
PX_FORCE_INLINE PxU32 getMaxNbTireTypes() const {return mMaxNbTireTypes;}
|
||||
|
||||
/**
|
||||
\brief Binary serialization of a PxVehicleDrivableSurfaceToTireFrictionPairs instance.
|
||||
The PxVehicleDrivableSurfaceToTireFrictionPairs instance is serialized to a PxOutputStream.
|
||||
The materials referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs instance are
|
||||
serialized to a PxCollection.
|
||||
\param[in] frictionTable is the PxVehicleDrivableSurfaceToTireFrictionPairs instance to be serialized.
|
||||
\param[in] materialIds are unique ids that will be used to add the materials to the collection.
|
||||
\param[in] nbMaterialIds is the length of the materialIds array. It must be sufficient to cover all materials.
|
||||
\param[out] collection is the PxCollection instance that is to be used to serialize the PxMaterial instances referenced by the
|
||||
PxVehicleDrivableSurfaceToTireFrictionPairs instance.
|
||||
\param[out] stream contains the memory block for the binary serialized friction table.
|
||||
\note If a material has already been added to the collection with a PxSerialObjectId, it will not be added again.
|
||||
\note If all materials have already been added to the collection with a PxSerialObjectId, it is legal to pass a NULL ptr for the materialIds array.
|
||||
\note frictionTable references PxMaterial instances, which are serialized using PxCollection.
|
||||
The PxCollection instance may be used to serialize an entire scene that also references some or none of those material instances
|
||||
or particular objects in a scene or nothing at all. The complementary deserialize() function requires the same collection instance
|
||||
or more typically a deserialized copy of the collection to be passed as a function argument.
|
||||
@see deserializeFromBinary
|
||||
*/
|
||||
static void serializeToBinary(const PxVehicleDrivableSurfaceToTireFrictionPairs& frictionTable, const PxSerialObjectId* materialIds, const PxU32 nbMaterialIds, PxCollection* collection, PxOutputStream& stream);
|
||||
|
||||
/**
|
||||
\brief Deserialize from a memory block to create a PxVehicleDrivableSurfaceToTireFrictionPairs instance.
|
||||
\param[in] collection contains the PxMaterial instances that will be referenced by the friction table.
|
||||
\param[in] memBlock is a binary array that may be retrieved or copied from the stream in the complementary serializeToBinary function.
|
||||
\return A PxVehicleDrivableSurfaceToTireFrictionPairs instance whose base address is equal to the memBlock ptr.
|
||||
@see serializeToBinary
|
||||
*/
|
||||
static PxVehicleDrivableSurfaceToTireFrictionPairs* deserializeFromBinary(const PxCollection& collection, void* memBlock);
|
||||
|
||||
private:
|
||||
|
||||
@@ -173,6 +227,11 @@ private:
|
||||
*/
|
||||
PxVehicleDrivableSurfaceType* mDrivableSurfaceTypes;
|
||||
|
||||
/**
|
||||
\brief A PxSerialObjectId per surface type used internally for serialization.
|
||||
*/
|
||||
PxSerialObjectId* mMaterialSerialIds;
|
||||
|
||||
/**
|
||||
\brief Number of different driving surface types.
|
||||
|
||||
@@ -203,13 +262,6 @@ private:
|
||||
*/
|
||||
PxU32 mMaxNbTireTypes;
|
||||
|
||||
|
||||
#if !PX_P64_FAMILY
|
||||
PxU32 mPad[1];
|
||||
#else
|
||||
PxU32 mPad[2];
|
||||
#endif
|
||||
|
||||
PxVehicleDrivableSurfaceToTireFrictionPairs(){}
|
||||
~PxVehicleDrivableSurfaceToTireFrictionPairs(){}
|
||||
};
|
||||
@@ -219,5 +271,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDrivableSurfaceToTireFrictionPairs) &
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_TIREFRICTION_H
|
||||
#endif
|
||||
|
||||
159
Source/ThirdParty/PhysX/vehicle/PxVehicleUpdate.h
vendored
159
Source/ThirdParty/PhysX/vehicle/PxVehicleUpdate.h
vendored
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,40 +22,37 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_UPDATE_H
|
||||
#define PX_VEHICLE_UPDATE_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "vehicle/PxVehicleSDK.h"
|
||||
#include "vehicle/PxVehicleTireFriction.h"
|
||||
#include "foundation/PxSimpleTypes.h"
|
||||
#include "foundation/PxMemory.h"
|
||||
#include "foundation/PxTransform.h"
|
||||
#include "PxBatchQueryDesc.h"
|
||||
#include "PxQueryFiltering.h"
|
||||
|
||||
#if !PX_DOXYGEN
|
||||
namespace physx
|
||||
{
|
||||
#endif
|
||||
|
||||
class PxBatchQuery;
|
||||
class PxContactModifyPair;
|
||||
class PxVehicleWheels;
|
||||
class PxVehicleDrivableSurfaceToTireFrictionPairs;
|
||||
class PxVehicleTelemetryData;
|
||||
class PxBatchQueryExt;
|
||||
|
||||
/**
|
||||
\brief Structure containing data describing the non-persistent state of each suspension/wheel/tire unit.
|
||||
This structure is filled out in PxVehicleUpdates and PxVehicleUpdateSingleVehicleAndStoreTelemetryData
|
||||
@see PxVehicleUpdates, PxVehicleUpdateSingleVehicleAndStoreTelemetryData
|
||||
*/
|
||||
struct PxWheelQueryResult
|
||||
struct PX_DEPRECATED PxWheelQueryResult
|
||||
{
|
||||
PxWheelQueryResult()
|
||||
{
|
||||
@@ -220,7 +216,7 @@ namespace physx
|
||||
PxTransform localPose;
|
||||
};
|
||||
|
||||
struct PxVehicleWheelQueryResult
|
||||
struct PX_DEPRECATED PxVehicleWheelQueryResult
|
||||
{
|
||||
/**
|
||||
\brief Pointer to an PxWheelQueryResult buffer of length nbWheelQueryResults
|
||||
@@ -240,12 +236,12 @@ namespace physx
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Structure containing data that is computed for a wheel during concurrent calls to PxVehicleUpdates
|
||||
but which cannot be safely concurrently applied.
|
||||
\brief Structure containing data that is computed for a wheel during concurrent calls to PxVehicleUpdates or
|
||||
PxVehicleUpdateSingleVehicleAndStoreTelemetryData but which cannot be safely concurrently applied.
|
||||
|
||||
@see PxVehicleUpdates, PxVehiclePostUpdates, PxVehicleConcurrentUpdate
|
||||
@see PxVehicleUpdates, PxVehicleUpdateSingleVehicleAndStoreTelemetryData, PxVehiclePostUpdates, PxVehicleConcurrentUpdate
|
||||
*/
|
||||
struct PxVehicleWheelConcurrentUpdateData
|
||||
struct PX_DEPRECATED PxVehicleWheelConcurrentUpdateData
|
||||
{
|
||||
friend class PxVehicleUpdate;
|
||||
|
||||
@@ -266,13 +262,13 @@ namespace physx
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Structure containing data that is computed for a vehicle and its wheels during concurrent calls to PxVehicleUpdates
|
||||
but which cannot be safely concurrently applied.
|
||||
\brief Structure containing data that is computed for a vehicle and its wheels during concurrent calls to PxVehicleUpdates or
|
||||
PxVehicleUpdateSingleVehicleAndStoreTelemetryData but which cannot be safely concurrently applied.
|
||||
|
||||
@see PxVehicleUpdates, PxVehiclePostUpdates, PxVehicleWheelConcurrentUpdateData
|
||||
@see PxVehicleUpdates, PxVehicleUpdateSingleVehicleAndStoreTelemetryData, PxVehiclePostUpdates, PxVehicleWheelConcurrentUpdateData
|
||||
*/
|
||||
|
||||
struct PxVehicleConcurrentUpdateData
|
||||
struct PX_DEPRECATED PxVehicleConcurrentUpdateData
|
||||
{
|
||||
friend class PxVehicleUpdate;
|
||||
|
||||
@@ -311,21 +307,18 @@ namespace physx
|
||||
/**
|
||||
\brief Perform raycasts for all suspension lines for all vehicles.
|
||||
|
||||
\param[in] batchQuery is a PxBatchQuery instance used to specify shader data and functions for the raycast scene queries.
|
||||
\param[in] batchQuery is a PxBatchQueryExt instance used to specify shader data and functions for the raycast scene queries.
|
||||
|
||||
\param[in] nbVehicles is the number of vehicles in the vehicles array.
|
||||
|
||||
\param[in] vehicles is an array of all vehicles that are to have a raycast issued from each wheel.
|
||||
|
||||
\param[in] nbSceneQueryResults must be greater than or equal to the total number of wheels of all the vehicles in the vehicles array; that is,
|
||||
sceneQueryResults must have dimensions large enough for one raycast hit result per wheel for all the vehicles in the vehicles array.
|
||||
|
||||
\param[in] sceneQueryResults must persist without being overwritten until the end of the next PxVehicleUpdates call.
|
||||
|
||||
\param[in] vehiclesToRaycast is an array of bools of length nbVehicles that is used to decide if raycasts will be performed for the corresponding vehicle
|
||||
in the vehicles array. If vehiclesToRaycast[i] is true then suspension line raycasts will be performed for vehicles[i]. If vehiclesToRaycast[i] is
|
||||
false then suspension line raycasts will not be performed for vehicles[i].
|
||||
|
||||
\param[in] queryFlags filter flags for the batched scene queries
|
||||
|
||||
\note If vehiclesToRaycast is NULL then raycasts are performed for all vehicles in the vehicles array.
|
||||
|
||||
\note If vehiclesToRaycast[i] is false then the vehicle stored in vehicles[i] will automatically use the raycast or sweep hit planes recorded by the most recent
|
||||
@@ -344,28 +337,23 @@ namespace physx
|
||||
\note Only blocking hits are supported (PxQueryHitType::eBLOCK).
|
||||
|
||||
@see PxVehicleDrive4W::setToRestState, PxVehicleDriveNW::setToRestState, PxVehicleDriveTank::setToRestState, PxVehicleNoDrive::setToRestState
|
||||
*/
|
||||
void PxVehicleSuspensionRaycasts
|
||||
(PxBatchQuery* batchQuery,
|
||||
const PxU32 nbVehicles, PxVehicleWheels** vehicles,
|
||||
const PxU32 nbSceneQueryResults, PxRaycastQueryResult* sceneQueryResults,
|
||||
const bool* vehiclesToRaycast = NULL);
|
||||
|
||||
@see PxBatchQueryExt::raycast
|
||||
*/
|
||||
PX_DEPRECATED void PxVehicleSuspensionRaycasts( PxBatchQueryExt* batchQuery,
|
||||
const PxU32 nbVehicles, PxVehicleWheels** vehicles,
|
||||
const bool* vehiclesToRaycast = NULL,
|
||||
const PxQueryFlags queryFlags = PxQueryFlag::eSTATIC | PxQueryFlag::eDYNAMIC | PxQueryFlag::ePREFILTER);
|
||||
|
||||
/**
|
||||
\brief Perform sweeps for all suspension lines for all vehicles.
|
||||
|
||||
\param[in] batchQuery is a PxBatchQuery instance used to specify shader data and functions for the sweep scene queries.
|
||||
\param[in] batchQuery is a PxBatchQueryExt instance used to specify shader data and functions for the sweep scene queries.
|
||||
|
||||
\param[in] nbVehicles is the number of vehicles in the vehicles array.
|
||||
|
||||
\param[in] vehicles is an array of all vehicles that are to have a sweep issued from each wheel.
|
||||
|
||||
\param[in] nbSceneQueryResults must be greater than or equal to the total number of wheels of all the vehicles in the vehicles array; that is,
|
||||
sceneQueryResults must have dimensions large enough for one sweep hit result per wheel for all the vehicles in the vehicles array.
|
||||
|
||||
\param[in] sceneQueryResults must persist without being overwritten until the end of the next PxVehicleUpdates call.
|
||||
|
||||
\param[in] nbHitsPerQuery is the maximum numbers of hits that will be returned for each query.
|
||||
|
||||
\param[in] vehiclesToSweep is an array of bools of length nbVehicles that is used to decide if sweeps will be performed for the corresponding vehicle
|
||||
@@ -374,7 +362,14 @@ namespace physx
|
||||
|
||||
\param[in] sweepWidthScale scales the geometry of the wheel used in the sweep. Values < 1 result in a thinner swept wheel, while values > 1 result in a fatter swept wheel.
|
||||
|
||||
\param[in] sweepRadiusScale scales the geometry of the wheel used in the sweep. Values < 1 result in a larger swept wheel, while values > 1 result in a smaller swept wheel.
|
||||
\param[in] sweepRadiusScale scales the geometry of the wheel used in the sweep. Values < 1 result in a smaller swept wheel, while values > 1 result in a larger swept wheel.
|
||||
|
||||
\param[in] sweepInflation Inflation parameter for sweeps. This is the inflation parameter from PxScene::sweep(). It inflates the shape and makes it rounder,
|
||||
which gives smoother and more reliable normals.
|
||||
|
||||
\param[in] queryFlags filter flags for the batched scene queries
|
||||
|
||||
\param[in] context the vehicle context to use for the suspension sweeps.
|
||||
|
||||
\note If vehiclesToSweep is NULL then sweeps are performed for all vehicles in the vehicles array.
|
||||
|
||||
@@ -403,16 +398,17 @@ namespace physx
|
||||
|
||||
@see PxVehicleDrive4W::setToRestState, PxVehicleDriveNW::setToRestState, PxVehicleDriveTank::setToRestState, PxVehicleNoDrive::setToRestState
|
||||
|
||||
@see PxBatchQuery::sweep
|
||||
@see PxBatchQueryExt::sweep PxScene::sweep()
|
||||
|
||||
@see PxVehicleSetSweepHitRejectionAngles
|
||||
*/
|
||||
void PxVehicleSuspensionSweeps
|
||||
(PxBatchQuery* batchQuery,
|
||||
const PxU32 nbVehicles, PxVehicleWheels** vehicles,
|
||||
const PxU32 nbSceneQueryResults, PxSweepQueryResult* sceneQueryResults, const PxU16 nbHitsPerQuery,
|
||||
const bool* vehiclesToSweep = NULL,
|
||||
const PxF32 sweepWidthScale = 1.0f, const PxF32 sweepRadiusScale = 1.0f);
|
||||
PX_DEPRECATED void PxVehicleSuspensionSweeps( PxBatchQueryExt* batchQuery,
|
||||
const PxU32 nbVehicles, PxVehicleWheels** vehicles,
|
||||
const PxU16 nbHitsPerQuery,
|
||||
const bool* vehiclesToSweep = NULL,
|
||||
const PxF32 sweepWidthScale = 1.0f, const PxF32 sweepRadiusScale = 1.0f, const PxF32 sweepInflation = 0.0f,
|
||||
const PxQueryFlags queryFlags = PxQueryFlag::eSTATIC | PxQueryFlag::eDYNAMIC | PxQueryFlag::ePREFILTER,
|
||||
const PxVehicleContext& context = PxVehicleGetDefaultContext());
|
||||
|
||||
/**
|
||||
\brief A function called from PxContactModifyCallback::onContactModify. The function determines if rigid body contact points
|
||||
@@ -435,7 +431,9 @@ namespace physx
|
||||
\param[in,out] contactModifyPair describes the set of contacts involving the PxShape of the specified wheel and one other shape. The contacts in the contact set are
|
||||
ignored or modified as required.
|
||||
|
||||
\note[in] Contact points are accepted or rejected using the threshold angles specified in the function PxVehicleSetSweepHitRejectionAngles.
|
||||
\param[in] context the vehicle context to use for the contact modification.
|
||||
|
||||
\note Contact points are accepted or rejected using the threshold angles specified in the function PxVehicleSetSweepHitRejectionAngles.
|
||||
|
||||
\note If a contact point is not rejected it is modified to account for the wheel rotation speed.
|
||||
|
||||
@@ -444,12 +442,13 @@ namespace physx
|
||||
\note Reduce maxImpulse if the wheels are frequently colliding with light objects with mass much less than the vehicle's mass.
|
||||
Reducing this value encourages numerical stability.
|
||||
|
||||
@see PxContactModifyCallback::onContactModify, PxVehicleSetSweepHitRejectionAngles
|
||||
@see PxContactModifyCallback::onContactModify, PxVehicleSetSweepHitRejectionAngles, PxVehicleContext
|
||||
*/
|
||||
PxU32 PxVehicleModifyWheelContacts
|
||||
PX_DEPRECATED PxU32 PxVehicleModifyWheelContacts
|
||||
(const PxVehicleWheels& vehicle, const PxU32 wheelId,
|
||||
const PxF32 wheelTangentVelocityMultiplier, const PxReal maxImpulse,
|
||||
PxContactModifyPair& contactModifyPair);
|
||||
PxContactModifyPair& contactModifyPair,
|
||||
const PxVehicleContext& context = PxVehicleGetDefaultContext());
|
||||
|
||||
|
||||
/**
|
||||
@@ -472,16 +471,18 @@ namespace physx
|
||||
\param[out] vehicleWheelQueryResults is an array of length nbVehicles storing the wheel query results of each corresponding vehicle and wheel in the
|
||||
vehicles array. A NULL pointer is permitted.
|
||||
|
||||
\param[out] vehicleConcurrentUpdates is an array of length nbVehicles. It is only necessary to specify vehicleConcurrentUpdates if PxVehicleUpdates is
|
||||
called concurrently. The element vehicleWheelQueryResults[i] of the array stores data that is computed for vehicle[i] during PxVehicleUpdates but which
|
||||
cannot be safely written when concurrently called. The data computed and stored in vehicleConcurrentUpdates must be passed to PxVehiclePostUpdates, where
|
||||
it is applied to all relevant actors in sequence. A NULL pointer is permitted.
|
||||
\param[out] vehicleConcurrentUpdates is an array of length nbVehicles. It is only necessary to specify vehicleConcurrentUpdates if PxVehicleUpdates is
|
||||
called concurrently (also concurrently with PxVehicleUpdateSingleVehicleAndStoreTelemetryData). The element vehicleConcurrentUpdates[i] of the array
|
||||
stores data that is computed for vehicle[i] during PxVehicleUpdates but which cannot be safely written when concurrently called. The data computed and
|
||||
stored in vehicleConcurrentUpdates must be passed to PxVehiclePostUpdates, where it is applied to all relevant actors in sequence. A NULL pointer is permitted.
|
||||
|
||||
\param[in] context the vehicle context to use for the vehicle update.
|
||||
|
||||
\note The vehicleWheelQueryResults buffer must persist until the end of PxVehicleUpdates.
|
||||
|
||||
\note The vehicleWheelQueryResults buffer is left unmodified for vehicles with sleeping rigid bodies whose control inputs indicate they should remain inert.
|
||||
|
||||
\note If PxVehicleUpdates is called concurrently then vehicleConcurrentUpdates must be specified. Do not specify vehicleConcurrentUpdates is PxVehicleUpdates
|
||||
\note If PxVehicleUpdates is called concurrently then vehicleConcurrentUpdates must be specified. Do not specify vehicleConcurrentUpdates if PxVehicleUpdates
|
||||
is not called concurrently.
|
||||
|
||||
\note The vehicleConcurrentUpdates buffer must persist until the end of PxVehiclePostUpdate.
|
||||
@@ -490,32 +491,38 @@ namespace physx
|
||||
with a PxShape (PxVehicleWheelsSimData::setWheelShapeMapping); the differential of the vehicle must be configured so that no drive torque
|
||||
is delivered to a disabled wheel; and the wheel must have zero rotation speed (PxVehicleWheelsDynData::setWheelRotationSpeed)
|
||||
|
||||
\note PxVehicleUpdates may be called concurrently provided all concurrent calls to PxVehicleUpdates involve only vehicles in the scene specified by PxVehicleUpdateSetScene.
|
||||
PxVehicleUpdates must never run concurrently with PxVehicleUpdateSingleVehicleAndStoreTelemetryData.
|
||||
\note Concurrent calls to PxVehicleUpdates and PxVehicleUpdateSingleVehicleAndStoreTelemetryData are permitted if the parameter
|
||||
vehicleConcurrentUpdates is used.
|
||||
|
||||
@see PxVehicleSetUpdateMode, PxVehicleWheelsSimData::disableWheel, PxVehicleWheelsSimData::setWheelShapeMapping, PxVehicleWheelsDynData::setWheelRotationSpeed,
|
||||
PxVehiclePostUpdates
|
||||
*/
|
||||
void PxVehicleUpdates(
|
||||
PX_DEPRECATED void PxVehicleUpdates(
|
||||
const PxReal timestep, const PxVec3& gravity,
|
||||
const PxVehicleDrivableSurfaceToTireFrictionPairs& vehicleDrivableSurfaceToTireFrictionPairs,
|
||||
const PxU32 nbVehicles, PxVehicleWheels** vehicles, PxVehicleWheelQueryResult* vehicleWheelQueryResults, PxVehicleConcurrentUpdateData* vehicleConcurrentUpdates = NULL);
|
||||
const PxU32 nbVehicles, PxVehicleWheels** vehicles, PxVehicleWheelQueryResult* vehicleWheelQueryResults, PxVehicleConcurrentUpdateData* vehicleConcurrentUpdates = NULL,
|
||||
const PxVehicleContext& context = PxVehicleGetDefaultContext());
|
||||
|
||||
|
||||
/**
|
||||
\brief Apply actor changes that were computed in concurrent calls to PxVehicleUpdates but which could not be safely applied due to the concurrency.
|
||||
\brief Apply actor changes that were computed in concurrent calls to PxVehicleUpdates or PxVehicleUpdateSingleVehicleAndStoreTelemetryData but
|
||||
which could not be safely applied due to the concurrency.
|
||||
|
||||
\param[in] vehicleConcurrentUpdates is an array of length nbVehicles where vehicleConcurrentUpdates[i] contains data describing actor changes that
|
||||
were computed for vehicles[i] during concurrent calls to PxVehicleUpdates.
|
||||
were computed for vehicles[i] during concurrent calls to PxVehicleUpdates or PxVehicleUpdateSingleVehicleAndStoreTelemetryData.
|
||||
|
||||
\param[in] nbVehicles is the number of vehicles pointers in the vehicles array
|
||||
|
||||
\param[in,out] vehicles is an array of length nbVehicles containing all vehicles that were partially updated in concurrent calls to PxVehicleUpdates.
|
||||
\param[in,out] vehicles is an array of length nbVehicles containing all vehicles that were partially updated in concurrent calls to PxVehicleUpdates or
|
||||
PxVehicleUpdateSingleVehicleAndStoreTelemetryData.
|
||||
|
||||
@see PxVehicleUpdates
|
||||
\param[in] context the vehicle context to use for the vehicle post update.
|
||||
|
||||
@see PxVehicleUpdates, PxVehicleUpdateSingleVehicleAndStoreTelemetryData
|
||||
*/
|
||||
void PxVehiclePostUpdates(
|
||||
const PxVehicleConcurrentUpdateData* vehicleConcurrentUpdates, const PxU32 nbVehicles, PxVehicleWheels** vehicles);
|
||||
PX_DEPRECATED void PxVehiclePostUpdates(
|
||||
const PxVehicleConcurrentUpdateData* vehicleConcurrentUpdates, const PxU32 nbVehicles, PxVehicleWheels** vehicles,
|
||||
const PxVehicleContext& context = PxVehicleGetDefaultContext());
|
||||
|
||||
|
||||
/**
|
||||
@@ -534,7 +541,7 @@ namespace physx
|
||||
|
||||
\param[in,out] vehicles is an array of all vehicles that should be updated to map to the new scene origin.
|
||||
*/
|
||||
void PxVehicleShiftOrigin(const PxVec3& shift, const PxU32 nbVehicles, PxVehicleWheels** vehicles);
|
||||
PX_DEPRECATED void PxVehicleShiftOrigin(const PxVec3& shift, const PxU32 nbVehicles, PxVehicleWheels** vehicles);
|
||||
|
||||
#if PX_DEBUG_VEHICLE_ON
|
||||
/**
|
||||
@@ -558,24 +565,34 @@ namespace physx
|
||||
|
||||
\param[out] telemetryData is the data structure used to record telemetry data during the update for later query or visualization
|
||||
|
||||
\note The vehicleWheelQueryResults buffer must persist until the end of PxVehicleUpdates
|
||||
\param[out] vehicleConcurrentUpdates is an array of length 1. It is only necessary to specify vehicleConcurrentUpdates if
|
||||
PxVehicleUpdateSingleVehicleAndStoreTelemetryData is called concurrently (also concurrently with PxVehicleUpdates). The
|
||||
PxVehicleConcurrentUpdateData struct stores data that cannot be safely written when concurrently called. The data computed and
|
||||
stored in vehicleConcurrentUpdates must be passed to PxVehiclePostUpdates, where it is applied to the vehicle actor. A NULL
|
||||
pointer is permitted.
|
||||
|
||||
\param[in] context the vehicle context to use for the vehicle update.
|
||||
|
||||
\note The vehicleWheelQueryResults buffer must persist until the end of PxVehicleUpdateSingleVehicleAndStoreTelemetryData
|
||||
|
||||
\note The vehicleWheelQueryResults buffer is left unmodified for vehicles with sleeping rigid bodies whose control inputs indicate they should remain inert.
|
||||
|
||||
\note PxVehicleUpdateSingleVehicleAndStoreTelemetryData is not thread-safe. As a consequence, it must run sequentially and never concurrently with PxVehicleUpdates
|
||||
\note Concurrent calls to PxVehicleUpdateSingleVehicleAndStoreTelemetryData and PxVehicleUpdates are permitted if the parameter
|
||||
vehicleConcurrentUpdates is used.
|
||||
|
||||
@see PxVehicleSetUpdateMode, PxVehicleTelemetryData
|
||||
@see PxVehiclePostUpdates, PxVehicleSetUpdateMode, PxVehicleTelemetryData
|
||||
*/
|
||||
void PxVehicleUpdateSingleVehicleAndStoreTelemetryData
|
||||
PX_DEPRECATED void PxVehicleUpdateSingleVehicleAndStoreTelemetryData
|
||||
(const PxReal timestep, const PxVec3& gravity,
|
||||
const PxVehicleDrivableSurfaceToTireFrictionPairs& vehicleDrivableSurfaceToTireFrictionPairs,
|
||||
PxVehicleWheels* focusVehicle, PxVehicleWheelQueryResult* vehicleWheelQueryResults,
|
||||
PxVehicleTelemetryData& telemetryData);
|
||||
PxVehicleTelemetryData& telemetryData,
|
||||
PxVehicleConcurrentUpdateData* vehicleConcurrentUpdates = NULL,
|
||||
const PxVehicleContext& context = PxVehicleGetDefaultContext());
|
||||
#endif
|
||||
|
||||
#if !PX_DOXYGEN
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_UPDATE_H
|
||||
#endif
|
||||
|
||||
17
Source/ThirdParty/PhysX/vehicle/PxVehicleUtil.h
vendored
17
Source/ThirdParty/PhysX/vehicle/PxVehicleUtil.h
vendored
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_UTILHELPER_H
|
||||
#define PX_VEHICLE_UTILHELPER_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
#ifndef PX_VEHICLE_UTIL_H
|
||||
#define PX_VEHICLE_UTIL_H
|
||||
|
||||
#include "foundation/Px.h"
|
||||
|
||||
@@ -54,11 +50,10 @@ that wheels disabled more recently than the last call to PxVehicleUpdates report
|
||||
|
||||
\return True if the vehicle is in the air, false if any wheel is touching the ground.
|
||||
*/
|
||||
bool PxVehicleIsInAir(const PxVehicleWheelQueryResult& vehWheelQueryResults);
|
||||
PX_DEPRECATED bool PxVehicleIsInAir(const PxVehicleWheelQueryResult& vehWheelQueryResults);
|
||||
|
||||
#if !PX_DOXYGEN
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_UTILHELPER_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,13 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_CONTROL_H
|
||||
#define PX_VEHICLE_CONTROL_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
#ifndef PX_VEHICLE_UTIL_CONTROL_H
|
||||
#define PX_VEHICLE_UTIL_CONTROL_H
|
||||
|
||||
#include "vehicle/PxVehicleSDK.h"
|
||||
#include "vehicle/PxVehicleDrive4W.h"
|
||||
#include "vehicle/PxVehicleDriveNW.h"
|
||||
@@ -47,14 +44,41 @@ namespace physx
|
||||
void testValidAnalogValue(const PxF32 actualValue, const PxF32 minVal, const PxF32 maxVal, const char* errorString);
|
||||
#endif
|
||||
|
||||
/**
|
||||
\brief Used to produce smooth steering values in the presence of discontinuities when a vehicle e.g. lands on the ground.
|
||||
Use a zero sharpness value to disable the feature (backward compatibility with previous PhysX versions).
|
||||
*/
|
||||
struct PX_DEPRECATED PxVehicleSteerFilter
|
||||
{
|
||||
PxVehicleSteerFilter(float sharpness=0.0f) : mSharpness(sharpness), mFilteredMaxSteer(0.0f) {}
|
||||
|
||||
static PX_FORCE_INLINE float feedbackFilter(float val, float& memory, float sharpness)
|
||||
{
|
||||
if(sharpness<0.0f) sharpness = 0.0f;
|
||||
else if(sharpness>1.0f) sharpness = 1.0f;
|
||||
return memory = val * sharpness + memory * (1.0f - sharpness);
|
||||
}
|
||||
|
||||
PX_FORCE_INLINE float computeMaxSteer(const bool isVehicleInAir, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
|
||||
const PxF32 vzAbs, const PxF32 timestep) const
|
||||
{
|
||||
const PxF32 targetMaxSteer = (isVehicleInAir ? 1.0f : steerVsForwardSpeedTable.getYVal(vzAbs));
|
||||
if(mSharpness==0.0f)
|
||||
return targetMaxSteer;
|
||||
else
|
||||
return feedbackFilter(targetMaxSteer, mFilteredMaxSteer, mSharpness*timestep);
|
||||
}
|
||||
|
||||
PxReal mSharpness;
|
||||
mutable PxReal mFilteredMaxSteer;
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Used to produce smooth vehicle driving control values from key inputs.
|
||||
@see PxVehicle4WSmoothDigitalRawInputsAndSetAnalogInputs, PxVehicle4WSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
*/
|
||||
struct PxVehicleKeySmoothingData
|
||||
struct PX_DEPRECATED PxVehicleKeySmoothingData
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
\brief Rise rate of each analog value if digital value is 1
|
||||
*/
|
||||
@@ -71,10 +95,8 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleKeySmoothingData)& 0x0f));
|
||||
\brief Used to produce smooth analog vehicle control values from analog inputs.
|
||||
@see PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs, PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
*/
|
||||
struct PxVehiclePadSmoothingData
|
||||
struct PX_DEPRECATED PxVehiclePadSmoothingData
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
\brief Rise rate of each analog value from previous value towards target if target>previous
|
||||
*/
|
||||
@@ -91,7 +113,7 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehiclePadSmoothingData)& 0x0f));
|
||||
\brief Used to produce smooth vehicle driving control values from analog and digital inputs.
|
||||
@see PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs, PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
*/
|
||||
class PxVehicleDrive4WRawInputData
|
||||
class PX_DEPRECATED PxVehicleDrive4WRawInputData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -286,13 +308,14 @@ private:
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] isVehicleInAir describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable.
|
||||
\param[in] focusVehicle is the vehicle that will be given analog and gearup/geardown control values arising from the digital inputs.
|
||||
\param[in] steerFilter is an optional smoothing filter for the steering angle.
|
||||
\param[in] forwardAxis The axis denoting the local space forward direction of the vehicle.
|
||||
*/
|
||||
void PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
PX_DEPRECATED void PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
(const PxVehicleKeySmoothingData& keySmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
|
||||
const PxVehicleDrive4WRawInputData& rawInputData,
|
||||
const PxReal timestep,
|
||||
const bool isVehicleInAir,
|
||||
PxVehicleDrive4W& focusVehicle);
|
||||
const PxVehicleDrive4WRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
|
||||
PxVehicleDrive4W& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
|
||||
const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
|
||||
|
||||
/**
|
||||
\brief Used to smooth and set analog vehicle control values from analog inputs (gamepad).
|
||||
@@ -300,23 +323,24 @@ Also used to set boolean gearup, geardown values.
|
||||
\param[in] padSmoothing describes how quickly the control values applied to the vehicle blend from the current vehicle values towards the raw analog values from the gamepad.
|
||||
\param[in] steerVsForwardSpeedTable is a table of maximum allowed steer versus forward vehicle speed.
|
||||
\param[in] rawInputData is the state of all gamepad analog inputs that will be used control the vehicle.
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
\param[in] isVehicleInAir describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable.
|
||||
\param[in] focusVehicle is the vehicle that will be given analog control values arising from the gamepad inputs.
|
||||
\param[in] steerFilter is an optional smoothing filter for the steering angle.
|
||||
\param[in] forwardAxis The axis denoting the local space forward direction of the vehicle.
|
||||
*/
|
||||
void PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
PX_DEPRECATED void PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
(const PxVehiclePadSmoothingData& padSmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
|
||||
const PxVehicleDrive4WRawInputData& rawInputData,
|
||||
const PxReal timestep,
|
||||
const bool isVehicleInAir,
|
||||
PxVehicleDrive4W& focusVehicle);
|
||||
const PxVehicleDrive4WRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
|
||||
PxVehicleDrive4W& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
|
||||
const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
|
||||
|
||||
|
||||
/**
|
||||
\brief Used to produce smooth vehicle driving control values from analog and digital inputs.
|
||||
@see PxVehicleDriveNWSmoothDigitalRawInputsAndSetAnalogInputs, PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
*/
|
||||
class PxVehicleDriveNWRawInputData : public PxVehicleDrive4WRawInputData
|
||||
class PX_DEPRECATED PxVehicleDriveNWRawInputData : public PxVehicleDrive4WRawInputData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -330,16 +354,17 @@ public:
|
||||
\param[in] keySmoothing describes the rise and fall rates of the corresponding analog values when keys are pressed on and off.
|
||||
\param[in] steerVsForwardSpeedTable is a table of maximum allowed steer versus forward vehicle speed.
|
||||
\param[in] rawInputData is the state of all digital inputs that control the vehicle.
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDriveNWSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] isVehicleInAir describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable.
|
||||
\param[in] focusVehicle is the vehicle that will be given analog and gearup/geardown control values arising from the digital inputs.
|
||||
\param[in] steerFilter is an optional smoothing filter for the steering angle.
|
||||
\param[in] forwardAxis The axis denoting the local space forward direction of the vehicle.
|
||||
*/
|
||||
void PxVehicleDriveNWSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
PX_DEPRECATED void PxVehicleDriveNWSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
(const PxVehicleKeySmoothingData& keySmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
|
||||
const PxVehicleDriveNWRawInputData& rawInputData,
|
||||
const PxReal timestep,
|
||||
const bool isVehicleInAir,
|
||||
PxVehicleDriveNW& focusVehicle);
|
||||
const PxVehicleDriveNWRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
|
||||
PxVehicleDriveNW& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
|
||||
const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
|
||||
|
||||
/**
|
||||
\brief Used to smooth and set analog vehicle control values from analog inputs (gamepad).
|
||||
@@ -347,23 +372,24 @@ Also used to set boolean gearup, geardown values.
|
||||
\param[in] padSmoothing describes how quickly the control values applied to the vehicle blend from the current vehicle values towards the raw analog values from the gamepad.
|
||||
\param[in] steerVsForwardSpeedTable is a table of maximum allowed steer versus forward vehicle speed.
|
||||
\param[in] rawInputData is the state of all gamepad analog inputs that will be used control the vehicle.
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
\param[in] isVehicleInAir describes if the vehicle is in the air or on the ground and is used to decide whether or not to apply steerVsForwardSpeedTable.
|
||||
\param[in] focusVehicle is the vehicle that will be given analog control values arising from the gamepad inputs.
|
||||
\param[in] steerFilter is an optional smoothing filter for the steering angle.
|
||||
\param[in] forwardAxis The axis denoting the local space forward direction of the vehicle.
|
||||
*/
|
||||
void PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
PX_DEPRECATED void PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
(const PxVehiclePadSmoothingData& padSmoothing, const PxFixedSizeLookupTable<8>& steerVsForwardSpeedTable,
|
||||
const PxVehicleDriveNWRawInputData& rawInputData,
|
||||
const PxReal timestep,
|
||||
const bool isVehicleInAir,
|
||||
PxVehicleDriveNW& focusVehicle);
|
||||
const PxVehicleDriveNWRawInputData& rawInputData, const PxReal timestep, const bool isVehicleInAir,
|
||||
PxVehicleDriveNW& focusVehicle, const PxVehicleSteerFilter& steerFilter = PxVehicleSteerFilter(),
|
||||
const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis);
|
||||
|
||||
|
||||
/**
|
||||
\brief Used to produce smooth analog tank control values from analog and digital inputs.
|
||||
@see PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs, PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
*/
|
||||
class PxVehicleDriveTankRawInputData
|
||||
class PX_DEPRECATED PxVehicleDriveTankRawInputData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -618,10 +644,10 @@ private:
|
||||
Also used to set boolean gearup, geardown values.
|
||||
\param[in] keySmoothing describes the rise and fall rates of the corresponding analog values when keys are pressed on and off.
|
||||
\param[in] rawInputData is the state of all digital inputs that control the vehicle.
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] focusVehicle is the vehicle that will be given analog and gearup/geardown control values arising from the digital inputs.
|
||||
*/
|
||||
void PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
PX_DEPRECATED void PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
(const PxVehicleKeySmoothingData& keySmoothing,
|
||||
const PxVehicleDriveTankRawInputData& rawInputData,
|
||||
const PxReal timestep,
|
||||
@@ -633,10 +659,10 @@ void PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
Also used to set boolean gearup, geardown values.
|
||||
\param[in] padSmoothing describes how quickly the control values applied to the vehicle blend from the current vehicle values towards the raw analog values from the gamepad.
|
||||
\param[in] rawInputData is the state of all gamepad analog inputs that will be used control the vehicle.
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs
|
||||
\param[in] timestep is the time that has passed since the last call to PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
\param[in] focusVehicle is the vehicle that will be given analog control values arising from the gamepad inputs.
|
||||
*/
|
||||
void PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
PX_DEPRECATED void PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
(const PxVehiclePadSmoothingData& padSmoothing,
|
||||
const PxVehicleDriveTankRawInputData& rawInputData,
|
||||
const PxReal timestep,
|
||||
@@ -647,5 +673,4 @@ void PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_CONTROL_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,13 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_UTILSSETUP_H
|
||||
#define PX_VEHICLE_UTILSSETUP_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
#ifndef PX_VEHICLE_UTIL_SETUP_H
|
||||
#define PX_VEHICLE_UTIL_SETUP_H
|
||||
|
||||
#include "foundation/PxSimpleTypes.h"
|
||||
#include "vehicle/PxVehicleSDK.h"
|
||||
|
||||
@@ -55,8 +52,10 @@ The suspension of the rear-right wheel is modified to support the entire mass of
|
||||
\param[in,out] wheelsSimData is the data describing the wheels/suspensions/tires of the vehicle.
|
||||
\param[in,out] wheelsDynData is the data describing the dynamic state of the wheels of the vehicle.
|
||||
\param[in,out] driveSimData is the data describing the drive model of the vehicle.
|
||||
\param[in] context the vehicle context to use for the setup.
|
||||
*/
|
||||
void PxVehicle4WEnable3WTadpoleMode(PxVehicleWheelsSimData& wheelsSimData, PxVehicleWheelsDynData& wheelsDynData, PxVehicleDriveSimData4W& driveSimData);
|
||||
PX_DEPRECATED void PxVehicle4WEnable3WTadpoleMode(PxVehicleWheelsSimData& wheelsSimData, PxVehicleWheelsDynData& wheelsDynData, PxVehicleDriveSimData4W& driveSimData,
|
||||
const PxVehicleContext& context = PxVehicleGetDefaultContext());
|
||||
|
||||
/**
|
||||
\brief Reconfigure a PxVehicle4W instance as a three-wheeled car with delta config (1 front wheel, 2 rear wheels)
|
||||
@@ -67,8 +66,10 @@ The suspension of the front-right wheel is modified to support the entire mass o
|
||||
\param[in,out] wheelsSimData is the data describing the wheels/suspensions/tires of the vehicle.
|
||||
\param[in,out] wheelsDynData is the data describing the dynamic state of the wheels of the vehicle.
|
||||
\param[in,out] driveSimData is the data describing the drive model of the vehicle.
|
||||
\param[in] context the vehicle context to use for the setup.
|
||||
*/
|
||||
void PxVehicle4WEnable3WDeltaMode(PxVehicleWheelsSimData& wheelsSimData, PxVehicleWheelsDynData& wheelsDynData, PxVehicleDriveSimData4W& driveSimData);
|
||||
PX_DEPRECATED void PxVehicle4WEnable3WDeltaMode(PxVehicleWheelsSimData& wheelsSimData, PxVehicleWheelsDynData& wheelsDynData, PxVehicleDriveSimData4W& driveSimData,
|
||||
const PxVehicleContext& context = PxVehicleGetDefaultContext());
|
||||
|
||||
/**
|
||||
\brief Compute the sprung masses of the suspension springs given (i) the number of sprung masses,
|
||||
@@ -87,7 +88,7 @@ a value of 1 corresponds to (0,-1,0) and a value of 2 corresponds to (0,0,-1).
|
||||
nbSprungMasses or greater. Each element in the sprungMasses array corresponds to the suspension located at the same array element in sprungMassCoordinates.
|
||||
The center of mass of the masses in sprungMasses with the coordinates in sprungMassCoordinates satisfy the specified centerOfMass.
|
||||
*/
|
||||
void PxVehicleComputeSprungMasses(const PxU32 nbSprungMasses, const PxVec3* sprungMassCoordinates, const PxVec3& centreOfMass, const PxReal totalMass, const PxU32 gravityDirection, PxReal* sprungMasses);
|
||||
PX_DEPRECATED void PxVehicleComputeSprungMasses(const PxU32 nbSprungMasses, const PxVec3* sprungMassCoordinates, const PxVec3& centreOfMass, const PxReal totalMass, const PxU32 gravityDirection, PxReal* sprungMasses);
|
||||
|
||||
|
||||
/**
|
||||
@@ -106,13 +107,13 @@ a value of 1 corresponds to (0,-1,0) and a value of 2 corresponds to (0,0,-1).
|
||||
\note The suspension sprung masses are updated so that the natural frequency and damping ratio of the springs are preserved. This involves altering the
|
||||
stiffness and damping rate of the suspension springs.
|
||||
*/
|
||||
void PxVehicleUpdateCMassLocalPose(const PxTransform& oldCMassLocalPose, const PxTransform& newCMassLocalPose, const PxU32 gravityDirection, PxVehicleWheels* vehicle);
|
||||
PX_DEPRECATED void PxVehicleUpdateCMassLocalPose(const PxTransform& oldCMassLocalPose, const PxTransform& newCMassLocalPose, const PxU32 gravityDirection, PxVehicleWheels* vehicle);
|
||||
|
||||
/**
|
||||
\brief Used by PxVehicleCopyDynamicsData
|
||||
@see PxVehicleCopyDynamicsData
|
||||
*/
|
||||
class PxVehicleCopyDynamicsMap
|
||||
class PX_DEPRECATED PxVehicleCopyDynamicsMap
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -149,12 +150,11 @@ speed of all enabled src wheels.
|
||||
|
||||
\note src and trg must be the same vehicle type.
|
||||
*/
|
||||
void PxVehicleCopyDynamicsData(const PxVehicleCopyDynamicsMap& wheelMap, const PxVehicleWheels& src, PxVehicleWheels* trg);
|
||||
PX_DEPRECATED void PxVehicleCopyDynamicsData(const PxVehicleCopyDynamicsMap& wheelMap, const PxVehicleWheels& src, PxVehicleWheels* trg);
|
||||
|
||||
|
||||
#if !PX_DOXYGEN
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_UTILSSETUP_H
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,15 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
#ifndef PX_VEHICLE_UTILSTELEMETRY_H
|
||||
#define PX_VEHICLE_UTILSTELEMETRY_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
#ifndef PX_VEHICLE_UTIL_TELEMETRY_H
|
||||
#define PX_VEHICLE_UTIL_TELEMETRY_H
|
||||
|
||||
#include "vehicle/PxVehicleSDK.h"
|
||||
#include "foundation/PxSimpleTypes.h"
|
||||
@@ -44,7 +40,7 @@ namespace physx
|
||||
|
||||
#if PX_DEBUG_VEHICLE_ON
|
||||
|
||||
class PxVehicleGraphDesc
|
||||
class PX_DEPRECATED PxVehicleGraphDesc
|
||||
{
|
||||
|
||||
friend class PxVehicleGraph;
|
||||
@@ -90,7 +86,7 @@ private:
|
||||
bool isValid() const;
|
||||
};
|
||||
|
||||
struct PxVehicleGraphChannelDesc
|
||||
struct PX_DEPRECATED PxVehicleGraphChannelDesc
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -134,7 +130,7 @@ private:
|
||||
bool isValid() const;
|
||||
};
|
||||
|
||||
struct PxVehicleWheelGraphChannel
|
||||
struct PX_DEPRECATED PxVehicleWheelGraphChannel
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -153,7 +149,7 @@ struct PxVehicleWheelGraphChannel
|
||||
};
|
||||
};
|
||||
|
||||
struct PxVehicleDriveGraphChannel
|
||||
struct PX_DEPRECATED PxVehicleDriveGraphChannel
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -170,7 +166,7 @@ struct PxVehicleDriveGraphChannel
|
||||
};
|
||||
};
|
||||
|
||||
struct PxVehicleGraphType
|
||||
struct PX_DEPRECATED PxVehicleGraphType
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -180,7 +176,7 @@ struct PxVehicleGraphType
|
||||
};
|
||||
|
||||
|
||||
class PxVehicleGraph
|
||||
class PX_DEPRECATED PxVehicleGraph
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -246,6 +242,14 @@ public:
|
||||
*/
|
||||
PxF32 getLatestValue(const PxU32 channel) const ;
|
||||
|
||||
/**
|
||||
\brief Get the raw data of a specific graph channel.
|
||||
|
||||
\param[in] channel is the ID of the graph channel to get data from.
|
||||
\param[out] values is the buffer to write the data to. Minimum required size is eMAX_NB_SAMPLES.
|
||||
*/
|
||||
void getRawData(const PxU32 channel, PxReal* values) const;
|
||||
|
||||
private:
|
||||
|
||||
//Min and max of each sample.
|
||||
@@ -300,7 +304,7 @@ private:
|
||||
PX_COMPILE_TIME_ASSERT(PxU32(PxVehicleGraph::eMAX_NB_CHANNELS) >= PxU32(PxVehicleWheelGraphChannel::eMAX_NB_WHEEL_CHANNELS) && PxU32(PxVehicleGraph::eMAX_NB_CHANNELS) >= PxU32(PxVehicleDriveGraphChannel::eMAX_NB_DRIVE_CHANNELS));
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleGraph) & 15));
|
||||
|
||||
class PxVehicleTelemetryData
|
||||
class PX_DEPRECATED PxVehicleTelemetryData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -406,5 +410,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleTelemetryData) & 15));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_UTILSTELEMETRY_H
|
||||
#endif
|
||||
|
||||
132
Source/ThirdParty/PhysX/vehicle/PxVehicleWheels.h
vendored
132
Source/ThirdParty/PhysX/vehicle/PxVehicleWheels.h
vendored
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
@@ -11,7 +10,7 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
@@ -23,16 +22,12 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
|
||||
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
|
||||
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
|
||||
|
||||
|
||||
#ifndef PX_VEHICLE_WHEELS_H
|
||||
#define PX_VEHICLE_WHEELS_H
|
||||
/** \addtogroup vehicle
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "foundation/PxSimpleTypes.h"
|
||||
#include "vehicle/PxVehicleShaders.h"
|
||||
@@ -57,7 +52,7 @@ class PxMaterial;
|
||||
|
||||
@see PxVehicleWheelsSimData::setFlags(), PxVehicleWheelsSimData::getFlags()
|
||||
*/
|
||||
struct PxVehicleWheelsSimFlag
|
||||
struct PX_DEPRECATED PxVehicleWheelsSimFlag
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
@@ -72,7 +67,49 @@ struct PxVehicleWheelsSimFlag
|
||||
this feature gives a slightly more realisitic behavior at the potential cost of more easily losing control
|
||||
when steering the vehicle.
|
||||
*/
|
||||
eLIMIT_SUSPENSION_EXPANSION_VELOCITY = (1 << 0)
|
||||
eLIMIT_SUSPENSION_EXPANSION_VELOCITY = (1 << 0),
|
||||
|
||||
/**
|
||||
\brief Disable internal cylinder-plane intersection test.
|
||||
|
||||
By default the internal code runs a post-process on sweep results, approximating the wheel shape with a
|
||||
cylinder and tweaking the sweep hit results accordingly. This can produce artefacts in certain cases, in
|
||||
particular when the swept shape is very different from a cylinder - e.g. with swept spheres. This flag
|
||||
tells the system to disable this internal test, and reuse the direct user-provided sweep results.
|
||||
|
||||
The default code refines the sweep results in each substep. Enabling this flag makes the system partially
|
||||
reuse the same sweep results over each substep, which could potentially create other artefacts.
|
||||
*/
|
||||
eDISABLE_INTERNAL_CYLINDER_PLANE_INTERSECTION_TEST = (1 << 1),
|
||||
|
||||
/**
|
||||
\brief Disable suspension force projection.
|
||||
|
||||
By default the internal code modulates the suspension force with the contact normal, i.e. the more the contact
|
||||
normal is aligned with the suspension direction, the bigger the force. This can create issues when using a
|
||||
single blocking hit, whose unique contact normal sometimes does not accurately capture the reality of the
|
||||
surrounding geometry. For example it can weaken the suspension force too much, which visually makes the wheel
|
||||
move up and down against e.g. a kerb. Enabling this flag tells the system to disable the modulation of the
|
||||
suspension force by the contact normal.
|
||||
|
||||
The rationale is that a real tire has a deformed contact patch containing multiple normals, and even if some
|
||||
of these normals are bent when colliding against a kerb, there would still be a large area of the contact patch
|
||||
touching the ground, and getting normals aligned with the suspension. This is difficult to capture with simple
|
||||
sweep results, especially with a single sweep hit whose normal is computed by a less than accurate algorithm
|
||||
like GJK. Using this flag shortcuts these issues, which can improves the behavior when driving over kerbs or
|
||||
small obstacles.
|
||||
*/
|
||||
eDISABLE_SUSPENSION_FORCE_PROJECTION = (1 << 2),
|
||||
|
||||
/**
|
||||
\brief Disable check for sprung mass values summing up to chassis mass.
|
||||
|
||||
Generally, the sum of the suspension sprung mass values should match the chassis mass. However, there can be
|
||||
scenarios where this is not necessarily desired. Taking a semi-trailer truck as an example, a large part of
|
||||
the trailer mass will rest on the tractor unit and not the trailer wheels. This flag allows the user to set
|
||||
the values as desired without error messages being sent.
|
||||
*/
|
||||
eDISABLE_SPRUNG_MASS_SUM_CHECK = (1 << 3)
|
||||
};
|
||||
};
|
||||
|
||||
@@ -88,7 +125,7 @@ PX_FLAGS_OPERATORS(PxVehicleWheelsSimFlag::Enum, PxU32)
|
||||
\brief Data structure describing configuration data of a vehicle with up to 20 wheels.
|
||||
*/
|
||||
|
||||
class PxVehicleWheelsSimData
|
||||
class PX_DEPRECATED PxVehicleWheelsSimData
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -584,10 +621,23 @@ public:
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleWheelsSimData) & 15));
|
||||
|
||||
|
||||
/**
|
||||
\brief Description of the per wheel intersection method to be used by PxVehicleWheelsDynData::setTireContacts()
|
||||
*/
|
||||
struct PX_DEPRECATED PxTireContactIntersectionMethod
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
eRAY = 0,
|
||||
eCYLINDER
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Data structure with instanced dynamics data for wheels
|
||||
*/
|
||||
class PxVehicleWheelsDynData
|
||||
class PX_DEPRECATED PxVehicleWheelsDynData
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -674,6 +724,24 @@ public:
|
||||
*/
|
||||
void copy(const PxVehicleWheelsDynData& src, const PxU32 srcWheel, const PxU32 trgWheel);
|
||||
|
||||
/**
|
||||
\brief Directly set tire contact plane and friction for all tires on the vehicle as an alternative to using PxVehicleSuspensionSweeps() or PxVehicleSuspensionRaycasts().
|
||||
\param[in] nbHits is an array describing whether each tire has a contact plane or not. Each element of the array is either 0 (no contact) or 1 (contact).
|
||||
\param[in] contactPlanes is an array of contact planes describing the contact plane per tire.
|
||||
\param[in] contactFrictions is the friction value of each tire contact with the drivable surface.
|
||||
\param[in] intersectionMethods describes how each tire will individually interact with its contact plane in order to compute the spring
|
||||
compression that places the tire on the contact plane. A value of eCYLINDER will compute the spring compression by intersecting the wheel's
|
||||
cylindrical shape with the contact plane. A value of eRAY will compute the spring compression by casting a ray through the wheel center
|
||||
and along the suspension direction until it hits the contact plane.
|
||||
\param[in] nbWheels is the length of the arrays nbContacts, contactPlanes, contactFrictions and intersectionMethods.
|
||||
\note Each contact plane (n, d) obeys the rule that all points P on the plane satisfy n.dot(P) + d = 0.0.
|
||||
\note The contact planes specified by setTireContacts() will persist as driving surfaces until either the next call to setTireContacts() or the next call to
|
||||
\note The friction values are scaled by PxVehicleTireData::mFrictionVsSlipGraph before being applied to the tire.
|
||||
\note The vehicle model assumes that the tire contacts are with static objects.
|
||||
PxVehicleSuspensionSweeps() or PxVehicleSuspensionRaycasts().
|
||||
*/
|
||||
void setTireContacts(const PxU32* nbHits, const PxPlane* contactPlanes, const PxReal* contactFrictions, const PxTireContactIntersectionMethod::Enum* intersectionMethods, const PxU32 nbWheels);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
@@ -723,6 +791,31 @@ public:
|
||||
PxU32 getNbWheelRotationAngle() const { return mNbActiveWheels; }
|
||||
PxVehicleWheels4DynData* getWheel4DynData() const { return mWheels4DynData; }
|
||||
//~serialization
|
||||
|
||||
/**
|
||||
\brief Retrieve the number of PxConstraint objects associated with the vehicle.
|
||||
|
||||
You can use #getConstraints() to retrieve the constraint pointers.
|
||||
|
||||
\return Number of constraints associated with this vehicle.
|
||||
|
||||
@see PxConstraint getConstraints()
|
||||
*/
|
||||
PxU32 getNbConstraints() const { return mNbWheels4; }
|
||||
|
||||
/**
|
||||
\brief Retrieve all the PxConstraint objects associated with the vehicle.
|
||||
|
||||
There is one PxConstraint per block of 4 wheels. The count can be extracted through #getNbConstraints()
|
||||
|
||||
\param[out] userBuffer The buffer to store the constraint pointers.
|
||||
\param[in] bufferSize Size of provided user buffer.
|
||||
\param[in] startIndex Index of first constraint pointer to be retrieved
|
||||
\return Number of constraint pointers written to the buffer.
|
||||
|
||||
@see PxConstraint getNbConstraints()
|
||||
*/
|
||||
PxU32 getConstraints(PxConstraint** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const;
|
||||
};
|
||||
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleWheelsDynData) & 15));
|
||||
|
||||
@@ -730,7 +823,7 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleWheelsDynData) & 15));
|
||||
\brief Data structure with instanced dynamics data and configuration data of a vehicle with just wheels
|
||||
@see PxVehicleDrive, PxVehicleDrive4W, PxVehicleDriveTank
|
||||
*/
|
||||
class PxVehicleWheels : public PxBase
|
||||
class PX_DEPRECATED PxVehicleWheels : public PxBase
|
||||
{
|
||||
//= ATTENTION! =====================================================================================
|
||||
// Changing the data layout of this class breaks the binary serialization format. See comments for
|
||||
@@ -761,15 +854,21 @@ public:
|
||||
|
||||
/**
|
||||
\brief Compute the rigid body velocity component along the forward vector of the rigid body transform.
|
||||
|
||||
\param[in] forwardAxis The axis denoting the local space forward direction of the vehicle.
|
||||
|
||||
@see PxVehicleSetBasisVectors
|
||||
*/
|
||||
PxReal computeForwardSpeed() const;
|
||||
PxReal computeForwardSpeed(const PxVec3& forwardAxis = PxVehicleGetDefaultContext().forwardAxis) const;
|
||||
|
||||
/**
|
||||
\brief Compute the rigid body velocity component along the right vector of the rigid body transform.
|
||||
|
||||
\param[in] sideAxis The axis denoting the local space side direction of the vehicle.
|
||||
|
||||
@see PxVehicleSetBasisVectors
|
||||
*/
|
||||
PxReal computeSidewaysSpeed() const;
|
||||
PxReal computeSidewaysSpeed(const PxVec3& sideAxis = PxVehicleGetDefaultContext().sideAxis) const;
|
||||
|
||||
/**
|
||||
\brief Data describing the setup of all the wheels/suspensions/tires.
|
||||
@@ -844,7 +943,7 @@ protected:
|
||||
#if PX_P64_FAMILY
|
||||
PxU8 mPad0[14];
|
||||
#else
|
||||
PxU8 mPad0[14];
|
||||
PxU8 mPad0[8];
|
||||
#endif
|
||||
|
||||
//serialization
|
||||
@@ -870,5 +969,4 @@ PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleWheels) & 15));
|
||||
} // namespace physx
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif //PX_VEHICLE_WHEELS_H
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user