PhysX SDK 3.2 API Reference: PxVehicleDrive4W.h Source File

PhysX SDK 3.2 API

PxVehicleDrive4W.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you 
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and 
00007 // any modifications thereto. Any use, reproduction, disclosure, or 
00008 // distribution of this software and related documentation without an express 
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 // 
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2008-2012 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 #ifndef PX_VEHICLE_4WDRIVE_H
00031 #define PX_VEHICLE_4WDRIVE_H
00032 
00036 #include "vehicle/PxVehicleDrive.h"
00037 #include "vehicle/PxVehicleWheels.h"
00038 #include "vehicle/PxVehicleComponents.h"
00039 
00040 #ifndef PX_DOXYGEN
00041 namespace physx
00042 {
00043 #endif
00044 
00045 struct PxFilterData;
00046 class PxGeometry;
00047 class PxPhysics;
00048 class PxBatchQuery;
00049 struct PxRaycastQueryResult;
00050 class PxVehicleDrivableSurfaceToTireFrictionPairs;
00051 class PxShape;
00052 class PxMaterial;
00053 class PxRigidDynamic;
00054 
00061 class PxVehicleDriveSimData4W : public PxVehicleDriveSimData
00062 {
00063 public:
00064 
00065     friend class PxVehicleDrive4W;
00066 
00070     PX_FORCE_INLINE const PxVehicleDifferential4WData& getDiffData() const 
00071     {
00072         return mDiff;
00073     }
00074 
00078     PX_FORCE_INLINE const PxVehicleAckermannGeometryData& getAckermannGeometryData() const 
00079     {
00080         return mAckermannGeometry;
00081     }
00082 
00086     void setDiffData(const PxVehicleDifferential4WData& diff);
00087 
00091     void setAckermannGeometryData(const PxVehicleAckermannGeometryData& ackermannData);
00092 
00093 private:
00094 
00099     PxVehicleDifferential4WData     mDiff;
00100 
00105     PxVehicleAckermannGeometryData  mAckermannGeometry;
00106 
00112     bool isValid() const;
00113 };
00114 PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveSimData4W) & 15));
00115 
00116 
00121 class PxVehicleDrive4W : public PxVehicleDrive
00122 {
00123 public:
00124 
00125     friend class PxVehicleUpdate;
00126 
00130     enum eWheelOrdering
00131     {
00132         eFRONT_LEFT_WHEEL=0,
00133         eFRONT_RIGHT_WHEEL,
00134         eREAR_LEFT_WHEEL,
00135         eREAR_RIGHT_WHEEL
00136     };
00137 
00141     enum
00142     {
00143         eANALOG_INPUT_ACCEL=PxVehicleDriveDynData::eANALOG_INPUT_ACCEL,     
00144         eANALOG_INPUT_BRAKE,        
00145         eANALOG_INPUT_HANDBRAKE,    
00146         eANALOG_INPUT_STEER_LEFT,   
00147         eANALOG_INPUT_STEER_RIGHT,  
00148         eMAX_NUM_DRIVE4W_ANALOG_INPUTS
00149     };
00150 
00155     static PxVehicleDrive4W* allocate(const PxU32 numWheels);
00156 
00161     void free();
00162 
00181     void setup
00182         (PxPhysics* physics, PxRigidDynamic* vehActor,
00183          const PxVehicleWheelsSimData& wheelsData, const PxVehicleDriveSimData4W& driveData,
00184          const PxU32 numNonDrivenWheels);
00185 
00204     static PxVehicleDrive4W* create
00205         (PxPhysics* physics, PxRigidDynamic* vehActor,
00206          const PxVehicleWheelsSimData& wheelsData, const PxVehicleDriveSimData4W& driveData,
00207          const PxU32 numNonDrivenWheels);
00208 
00213     void setToRestState();
00214 
00219     PxVehicleDriveSimData4W mDriveSimData;
00220 
00221 private:
00222 
00223     PxVehicleDrive4W()
00224     {
00225     }
00226 
00227     ~PxVehicleDrive4W()
00228     {
00229     }
00230 
00234     bool isValid() const;
00235 };
00236 PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDrive4W) & 15));
00237 
00238 #ifndef PX_DOXYGEN
00239 } // namespace physx
00240 #endif
00241 
00243 #endif //PX_VEHICLE_4WDRIVE_H


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