Main Page
Class Hierarchy
Compound List
Compound Members
Include
vehicle
PxVehicleDriveNW.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_NWDRIVE_H
14
#define PX_VEHICLE_NWDRIVE_H
15
19
#include "
vehicle/PxVehicleDrive.h
"
20
#include "
vehicle/PxVehicleWheels.h
"
21
#include "
vehicle/PxVehicleComponents.h
"
22
23
#ifndef PX_DOXYGEN
24
namespace
physx
25
{
26
#endif
27
28
struct
PxFilterData
;
29
class
PxGeometry
;
30
class
PxPhysics
;
31
class
PxBatchQuery
;
32
class
PxVehicleDrivableSurfaceToTireFrictionPairs
;
33
class
PxShape
;
34
class
PxMaterial
;
35
class
PxRigidDynamic
;
36
42
class
PxVehicleDriveSimDataNW
:
public
PxVehicleDriveSimData
43
{
44
//= ATTENTION! =====================================================================================
45
// Changing the data layout of this class breaks the binary serialization format. See comments for
46
// PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
47
// function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
48
// accordingly.
49
//==================================================================================================
50
public
:
51
52
friend
class
PxVehicleDriveNW
;
53
54
PxVehicleDriveSimDataNW
()
55
:
PxVehicleDriveSimData
()
56
{
57
}
58
62
const
PxVehicleDifferentialNWData
& getDiffData()
const
63
{
64
return
mDiff;
65
}
66
71
void
setDiffData(
const
PxVehicleDifferentialNWData
& diff);
72
73
private
:
74
79
PxVehicleDifferentialNWData
mDiff
;
80
86
bool
isValid
()
const
;
87
88
//serialization
89
public
:
90
PxVehicleDriveSimDataNW
(
const
PxEMPTY
&) :
PxVehicleDriveSimData
(
PxEmpty
), mDiff(
PxEmpty
) {}
91
static
void
getBinaryMetaData
(
PxOutputStream
& stream);
92
//~serialization
93
};
94
PX_COMPILE_TIME_ASSERT
(0==(
sizeof
(
PxVehicleDriveSimDataNW
) & 15));
95
96
102
struct
PxVehicleDriveNWControl
103
{
104
enum
Enum
105
{
106
eANALOG_INPUT_ACCEL=0,
107
eANALOG_INPUT_BRAKE
,
108
eANALOG_INPUT_HANDBRAKE
,
109
eANALOG_INPUT_STEER_LEFT
,
110
eANALOG_INPUT_STEER_RIGHT
,
111
eMAX_NB_DRIVENW_ANALOG_INPUTS
112
};
113
};
114
118
class
PxVehicleDriveNW
:
public
PxVehicleDrive
119
{
120
//= ATTENTION! =====================================================================================
121
// Changing the data layout of this class breaks the binary serialization format. See comments for
122
// PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
123
// function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
124
// accordingly.
125
//==================================================================================================
126
public
:
127
128
friend
class
PxVehicleUpdate;
129
139
static
PxVehicleDriveNW
* allocate(
const
PxU32
nbWheels);
140
145
void
free();
146
157
void
setup
158
(
PxPhysics
* physics,
PxRigidDynamic
* vehActor,
159
const
PxVehicleWheelsSimData
& wheelsData,
const
PxVehicleDriveSimDataNW
& driveData,
160
const
PxU32
nbWheels);
161
173
static
PxVehicleDriveNW
* create
174
(
PxPhysics
* physics,
PxRigidDynamic
* vehActor,
175
const
PxVehicleWheelsSimData
& wheelsData,
const
PxVehicleDriveSimDataNW
& driveData,
176
const
PxU32
nbWheels);
177
185
void
setToRestState();
186
191
PxVehicleDriveSimDataNW
mDriveSimData
;
192
193
private
:
194
198
bool
isValid()
const
;
199
200
//serialization
201
public
:
202
PxVehicleDriveNW
(
PxBaseFlags
baseFlags) :
PxVehicleDrive
(baseFlags), mDriveSimData(
PxEmpty
) {}
203
PxVehicleDriveNW
();
204
~PxVehicleDriveNW
(){}
205
static
PxVehicleDriveNW
* createObject(
PxU8
*& address,
PxDeserializationContext
& context);
206
static
void
getBinaryMetaData(
PxOutputStream
& stream);
207
virtual
const
char
*
getConcreteTypeName
()
const
{
return
"PxVehicleDriveNW"
; }
208
virtual
bool
isKindOf
(
const
char
* name)
const
{
return
!strcmp(
"PxVehicleDriveNW"
, name) ||
PxBase::isKindOf
(name); }
209
//~serialization
210
};
211
PX_COMPILE_TIME_ASSERT
(0==(
sizeof
(
PxVehicleDriveNW
) & 15));
212
213
214
215
#ifndef PX_DOXYGEN
216
}
// namespace physx
217
#endif
218
220
#endif //PX_VEHICLE_NWDRIVE_H
Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.
www.nvidia.com