Main Page
Class Hierarchy
Compound List
Compound Members
Include
vehicle
PxVehicleDriveTank.h
Go to the documentation of this file.
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_DRIVE_TANK_H
14
#define PX_VEHICLE_DRIVE_TANK_H
15
19
#include "
vehicle/PxVehicleDrive.h
"
20
#include "
vehicle/PxVehicleWheels.h
"
21
#include "
vehicle/PxVehicleComponents.h
"
22
23
24
#ifndef PX_DOXYGEN
25
namespace
physx
26
{
27
#endif
28
29
struct
PxFilterData
;
30
class
PxGeometry
;
31
class
PxPhysics
;
32
class
PxBatchQuery
;
33
class
PxVehicleDrivableSurfaceToTireFrictionPairs
;
34
class
PxShape
;
35
class
PxMaterial
;
36
class
PxRigidDynamic
;
37
43
struct
PxVehicleDriveTankWheelOrder
44
{
45
enum
Enum
46
{
47
eFRONT_LEFT=0,
48
eFRONT_RIGHT
,
49
e1ST_FROM_FRONT_LEFT
,
50
e1ST_FROM_FRONT_RIGHT
,
51
e2ND_FROM_FRONT_LEFT
,
52
e2ND_FROM_FRONT_RIGHT
,
53
e3RD_FROM_FRONT_LEFT
,
54
e3RD_FROM_FRONT_RIGHT
,
55
e4TH_FROM_FRONT_LEFT
,
56
e4TH_FROM_FRONT_RIGHT
,
57
e5TH_FROM_FRONT_LEFT
,
58
e5TH_FROM_FRONT_RIGHT
,
59
e6TH_FROM_FRONT_LEFT
,
60
e6TH_FROM_FRONT_RIGHT
,
61
e7TH_FROM_FRONT_LEFT
,
62
e7TH_FROM_FRONT_RIGHT
,
63
e8TH_FROM_FRONT_LEFT
,
64
e8TH_FROM_FRONT_RIGHT
,
65
e9TH_FROM_FRONT_LEFT
,
66
e9TH_FROM_FRONT_RIGHT
67
};
68
};
69
70
89
struct
PxVehicleDriveTankControl
90
{
91
enum
Enum
92
{
93
eANALOG_INPUT_ACCEL=0,
94
eANALOG_INPUT_BRAKE_LEFT
,
95
eANALOG_INPUT_BRAKE_RIGHT
,
96
eANALOG_INPUT_THRUST_LEFT
,
97
eANALOG_INPUT_THRUST_RIGHT
,
98
eMAX_NB_DRIVETANK_ANALOG_INPUTS
99
};
100
};
101
121
struct
PxVehicleDriveTankControlModel
122
{
123
enum
Enum
124
{
125
eSTANDARD=0,
126
eSPECIAL
127
};
128
};
129
130
134
class
PxVehicleDriveTank
:
public
PxVehicleDrive
135
{
136
//= ATTENTION! =====================================================================================
137
// Changing the data layout of this class breaks the binary serialization format. See comments for
138
// PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
139
// function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
140
// accordingly.
141
//==================================================================================================
142
public
:
143
144
friend
class
PxVehicleUpdate;
145
146
158
static
PxVehicleDriveTank
* allocate(
const
PxU32
nbWheels);
159
164
void
free();
165
179
void
setup
180
(
PxPhysics
* physics,
PxRigidDynamic
* vehActor,
181
const
PxVehicleWheelsSimData
& wheelsData,
const
PxVehicleDriveSimData
& driveData,
182
const
PxU32
nbDrivenWheels);
183
195
static
PxVehicleDriveTank
* create
196
(
PxPhysics
* physics,
PxRigidDynamic
* vehActor,
197
const
PxVehicleWheelsSimData
& wheelsData,
const
PxVehicleDriveSimData
& driveData,
198
const
PxU32
nbDrivenWheels);
199
206
void
setDriveModel(
const
PxVehicleDriveTankControlModel::Enum
driveModel)
207
{
208
mDriveModel=driveModel;
209
}
210
214
PxVehicleDriveTankControlModel::Enum
getDriveModel
()
const
{
return
mDriveModel;}
215
223
void
setToRestState();
224
229
PxVehicleDriveSimData
mDriveSimData
;
230
231
private
:
235
bool
isValid()
const
;
236
241
PxVehicleDriveTankControlModel::Enum
mDriveModel
;
242
243
PxU32
mPad[3];
244
245
//serialization
246
public
:
247
PxVehicleDriveTank
(
PxBaseFlags
baseFlags) :
PxVehicleDrive
(baseFlags) {}
248
static
PxVehicleDriveTank
* createObject(
PxU8
*& address,
PxDeserializationContext
& context);
249
static
void
getBinaryMetaData(
PxOutputStream
& stream);
250
virtual
const
char
*
getConcreteTypeName
()
const
{
return
"PxVehicleDriveTank"
; }
251
virtual
bool
isKindOf
(
const
char
* name)
const
{
return
!strcmp(
"PxVehicleDriveTank"
, name) ||
PxBase::isKindOf
(name); }
252
protected
:
253
PxVehicleDriveTank
();
254
~PxVehicleDriveTank
(){}
255
//~serialization
256
};
257
PX_COMPILE_TIME_ASSERT
(0==(
sizeof
(
PxVehicleDriveTank
) & 15));
258
259
#ifndef PX_DOXYGEN
260
}
// namespace physx
261
#endif
262
264
#endif //PX_VEHICLE_DRIVE_TANK_H
Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.
www.nvidia.com