PxVehicleDrive4W.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_4WDRIVE_H
14 #define PX_VEHICLE_4WDRIVE_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 //= ATTENTION! =====================================================================================
46 // Changing the data layout of this class breaks the binary serialization format. See comments for
47 // PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
48 // function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
49 // accordingly.
50 //==================================================================================================
51 public:
52 
53  friend class PxVehicleDrive4W;
54 
57  {
58  }
59 
64  PX_FORCE_INLINE const PxVehicleDifferential4WData& getDiffData() const
65  {
66  return mDiff;
67  }
68 
73  PX_FORCE_INLINE const PxVehicleAckermannGeometryData& getAckermannGeometryData() const
74  {
75  return mAckermannGeometry;
76  }
77 
82  void setDiffData(const PxVehicleDifferential4WData& diff);
83 
88  void setAckermannGeometryData(const PxVehicleAckermannGeometryData& ackermannData);
89 
90 private:
91 
97 
103 
109  bool isValid() const;
110 
111 //serialization
112 public:
113  PxVehicleDriveSimData4W(const PxEMPTY&) : PxVehicleDriveSimData(PxEmpty), mDiff(PxEmpty), mAckermannGeometry(PxEmpty) {}
114  static void getBinaryMetaData(PxOutputStream& stream);
115 //~serialization
116 };
118 
119 
120 
128 {
129  enum Enum
130  {
131  eFRONT_LEFT=0,
134  eREAR_RIGHT
135  };
136 };
137 
145 {
146  enum Enum
147  {
148  eANALOG_INPUT_ACCEL=0,
153  eMAX_NB_DRIVE4W_ANALOG_INPUTS
154  };
155 };
156 
161 {
162 //= ATTENTION! =====================================================================================
163 // Changing the data layout of this class breaks the binary serialization format. See comments for
164 // PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
165 // function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
166 // accordingly.
167 //==================================================================================================
168 public:
169  friend class PxVehicleUpdate;
170 
180  static PxVehicleDrive4W* allocate(const PxU32 nbWheels);
181 
186  void free();
187 
199  void setup
200  (PxPhysics* physics, PxRigidDynamic* vehActor,
201  const PxVehicleWheelsSimData& wheelsData, const PxVehicleDriveSimData4W& driveData,
202  const PxU32 nbNonDrivenWheels);
203 
216  static PxVehicleDrive4W* create
217  (PxPhysics* physics, PxRigidDynamic* vehActor,
218  const PxVehicleWheelsSimData& wheelsData, const PxVehicleDriveSimData4W& driveData,
219  const PxU32 nbNonDrivenWheels);
220 
228  void setToRestState();
229 
235 
236 private:
237 
241  bool isValid() const;
242 
243 //serialization
244 protected:
247  virtual bool isKindOf(const char* name) const { return !strcmp("PxVehicleDrive4W", name) || PxBase::isKindOf(name); }
248 public:
249  static PxVehicleDrive4W* createObject(PxU8*& address, PxDeserializationContext& context);
250  static void getBinaryMetaData(PxOutputStream& stream);
251  PxVehicleDrive4W(PxBaseFlags baseFlags) : PxVehicleDrive(baseFlags), mDriveSimData(PxEmpty) {}
252  virtual const char* getConcreteTypeName() const { return "PxVehicleDrive4W"; }
253 //~serialization
254 };
255 PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDrive4W) & 15));
256 
257 #ifndef PX_DOXYGEN
258 } // namespace physx
259 #endif
260 
262 #endif //PX_VEHICLE_4WDRIVE_H


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com