1/*
2 * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3 *
4 * NVIDIA CORPORATION and its licensors retain all intellectual property
5 * and proprietary rights in and to this software, related documentation
6 * and any modifications thereto. Any use, reproduction, disclosure or
7 * distribution of this software and related documentation without an express
8 * license agreement from NVIDIA CORPORATION is strictly prohibited.
9 */
10// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12
13#ifndef PX_VEHICLE_SDK_H
14#define PX_VEHICLE_SDK_H
15/** \addtogroup vehicle
16 @{
17*/
18
19#include "foundation/Px.h"
20#include "common/PxTypeInfo.h"
21
22#ifndef PX_DOXYGEN
23namespace physx
24{
25#endif
26
27class PxPhysics;
28class PxSerializationRegistry;
29
30/**
31\brief Initialize the PhysXVehicle library.
32
33Call this before using any of the vehicle functions.
34
35\param physics The PxPhysics instance.
36\param serializationRegistry PxSerializationRegistry instance, if NULL vehicle serialization is not supported.
37
38\note This function must be called after PxFoundation and PxPhysics instances have been created.
39\note If a PxSerializationRegistry instance is specified then PhysXVehicle is also dependent on PhysXExtensions.
40
41@see PxCloseVehicleSDK
42*/
43PX_C_EXPORT bool PX_CALL_CONV PxInitVehicleSDK(PxPhysics& physics, PxSerializationRegistry* serializationRegistry = NULL);
44
45
46/**
47\brief Shut down the PhysXVehicle library.
48
49Call this function as part of the physx shutdown process.
50
51\param serializationRegistry PxSerializationRegistry instance, if non-NULL must be the same as passed into PxInitVehicleSDK.
52
53\note This function must be called prior to shutdown of PxFoundation and PxPhysics.
54\note If the PxSerializationRegistry instance is specified this function must additionally be called prior to shutdown of PhysXExtensions.
55
56@see PxInitVehicleSDK
57*/
58PX_C_EXPORT void PX_CALL_CONV PxCloseVehicleSDK(PxSerializationRegistry* serializationRegistry = NULL);
59
60
61/**
62\brief This number is the maximum number of wheels allowed for a vehicle.
63*/
64#define PX_MAX_NB_WHEELS (20)
65
66
67/**
68\brief Compiler setting to enable recording of telemetry data
69
70@see PxVehicleUpdateSingleVehicleAndStoreTelemetryData, PxVehicleTelemetryData
71*/
72#define PX_DEBUG_VEHICLE_ON (1)
73
74
75/**
76@see PxVehicleDrive4W, PxVehicleDriveTank, PxVehicleDriveNW, PxVehicleNoDrive, PxVehicleWheels::getVehicleType
77*/
78struct PxVehicleTypes
79{
80 enum Enum
81 {
82 eDRIVE4W=0,
83 eDRIVENW,
84 eDRIVETANK,
85 eNODRIVE,
86 eUSER1,
87 eUSER2,
88 eUSER3,
89 eMAX_NB_VEHICLE_TYPES
90 };
91};
92
93
94/**
95\brief An enumeration of concrete vehicle classes inheriting from PxBase.
96\note This enum can be used to identify a vehicle object stored in a PxCollection.
97@see PxBase, PxTypeInfo, PxBase::getConcreteType
98*/
99struct PxVehicleConcreteType
100{
101 enum Enum
102 {
103 eVehicleNoDrive = PxConcreteType::eFIRST_VEHICLE_EXTENSION,
104 eVehicleDrive4W,
105 eVehicleDriveNW,
106 eVehicleDriveTank
107 };
108};
109
110
111/**
112\brief Set the basis vectors of the vehicle simulation
113
114Default values PxVec3(0,1,0), PxVec3(0,0,1)
115
116Call this function before using PxVehicleUpdates unless the default values are correct.
117*/
118void PxVehicleSetBasisVectors(const PxVec3& up, const PxVec3& forward);
119
120
121/**
122@see PxVehicleSetUpdateMode
123*/
124struct PxVehicleUpdateMode
125{
126 enum Enum
127 {
128 eVELOCITY_CHANGE,
129 eACCELERATION
130 };
131};
132
133
134/**
135\brief Set the effect of PxVehicleUpdates to be either to modify each vehicle's rigid body actor
136
137with an acceleration to be applied in the next PhysX SDK update or as an immediate velocity modification.
138
139Default behavior is immediate velocity modification.
140
141Call this function before using PxVehicleUpdates for the first time if the default is not the desired behavior.
142
143@see PxVehicleUpdates
144*/
145void PxVehicleSetUpdateMode(PxVehicleUpdateMode::Enum vehicleUpdateMode);
146
147#ifndef PX_DOXYGEN
148} // namespace physx
149#endif
150
151/** @} */
152#endif //PX_VEHICLE_SDK_H
153