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"
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;
34 class PxShape;
35 class PxMaterial;
36 class PxRigidDynamic;
37 
44 {
45  enum Enum
46  {
47  eFRONT_LEFT=0,
66  e9TH_FROM_FRONT_RIGHT
67  };
68 };
69 
70 
90 {
91  enum Enum
92  {
93  eANALOG_INPUT_ACCEL=0,
98  eMAX_NB_DRIVETANK_ANALOG_INPUTS
99  };
100 };
101 
122 {
123  enum Enum
124  {
125  eSTANDARD=0,
126  eSPECIAL
127  };
128 };
129 
130 
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 
215 
223  void setToRestState();
224 
230 
231 private:
235  bool isValid() const;
236 
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:
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