00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef PX_VEHICLE_DRIVE_TANK_H
00031 #define PX_VEHICLE_DRIVE_TANK_H
00032
00036 #include "vehicle/PxVehicleDrive.h"
00037 #include "vehicle/PxVehicleWheels.h"
00038 #include "vehicle/PxVehicleComponents.h"
00039
00040
00041 #if !PX_DOXYGEN
00042 namespace physx
00043 {
00044 #endif
00045
00046 struct PxFilterData;
00047 class PxGeometry;
00048 class PxPhysics;
00049 class PxBatchQuery;
00050 class PxVehicleDrivableSurfaceToTireFrictionPairs;
00051 class PxShape;
00052 class PxMaterial;
00053 class PxRigidDynamic;
00054
00060 struct PxVehicleDriveTankWheelOrder
00061 {
00062 enum Enum
00063 {
00064 eFRONT_LEFT=0,
00065 eFRONT_RIGHT,
00066 e1ST_FROM_FRONT_LEFT,
00067 e1ST_FROM_FRONT_RIGHT,
00068 e2ND_FROM_FRONT_LEFT,
00069 e2ND_FROM_FRONT_RIGHT,
00070 e3RD_FROM_FRONT_LEFT,
00071 e3RD_FROM_FRONT_RIGHT,
00072 e4TH_FROM_FRONT_LEFT,
00073 e4TH_FROM_FRONT_RIGHT,
00074 e5TH_FROM_FRONT_LEFT,
00075 e5TH_FROM_FRONT_RIGHT,
00076 e6TH_FROM_FRONT_LEFT,
00077 e6TH_FROM_FRONT_RIGHT,
00078 e7TH_FROM_FRONT_LEFT,
00079 e7TH_FROM_FRONT_RIGHT,
00080 e8TH_FROM_FRONT_LEFT,
00081 e8TH_FROM_FRONT_RIGHT,
00082 e9TH_FROM_FRONT_LEFT,
00083 e9TH_FROM_FRONT_RIGHT
00084 };
00085 };
00086
00087
00106 struct PxVehicleDriveTankControl
00107 {
00108 enum Enum
00109 {
00110 eANALOG_INPUT_ACCEL=0,
00111 eANALOG_INPUT_BRAKE_LEFT,
00112 eANALOG_INPUT_BRAKE_RIGHT,
00113 eANALOG_INPUT_THRUST_LEFT,
00114 eANALOG_INPUT_THRUST_RIGHT,
00115 eMAX_NB_DRIVETANK_ANALOG_INPUTS
00116 };
00117 };
00118
00138 struct PxVehicleDriveTankControlModel
00139 {
00140 enum Enum
00141 {
00142 eSTANDARD=0,
00143 eSPECIAL
00144 };
00145 };
00146
00147
00151 class PxVehicleDriveTank : public PxVehicleDrive
00152 {
00153
00154
00155
00156
00157
00158
00159 public:
00160
00161 friend class PxVehicleUpdate;
00162
00163
00175 static PxVehicleDriveTank* allocate(const PxU32 nbWheels);
00176
00181 void free();
00182
00196 void setup
00197 (PxPhysics* physics, PxRigidDynamic* vehActor,
00198 const PxVehicleWheelsSimData& wheelsData, const PxVehicleDriveSimData& driveData,
00199 const PxU32 nbDrivenWheels);
00200
00212 static PxVehicleDriveTank* create
00213 (PxPhysics* physics, PxRigidDynamic* vehActor,
00214 const PxVehicleWheelsSimData& wheelsData, const PxVehicleDriveSimData& driveData,
00215 const PxU32 nbDrivenWheels);
00216
00223 void setDriveModel(const PxVehicleDriveTankControlModel::Enum driveModel)
00224 {
00225 mDriveModel=driveModel;
00226 }
00227
00231 PxVehicleDriveTankControlModel::Enum getDriveModel() const {return mDriveModel;}
00232
00240 void setToRestState();
00241
00246 PxVehicleDriveSimData mDriveSimData;
00247
00248 private:
00252 bool isValid() const;
00253
00258 PxVehicleDriveTankControlModel::Enum mDriveModel;
00259
00260 PxU32 mPad[3];
00261
00262
00263 public:
00264 PxVehicleDriveTank(PxBaseFlags baseFlags) : PxVehicleDrive(baseFlags) {}
00265 static PxVehicleDriveTank* createObject(PxU8*& address, PxDeserializationContext& context);
00266 static void getBinaryMetaData(PxOutputStream& stream);
00267 virtual const char* getConcreteTypeName() const { return "PxVehicleDriveTank"; }
00268 virtual bool isKindOf(const char* name) const { return !::strcmp("PxVehicleDriveTank", name) || PxBase::isKindOf(name); }
00269 protected:
00270 PxVehicleDriveTank();
00271 ~PxVehicleDriveTank(){}
00272
00273 };
00274 PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDriveTank) & 15));
00275
00276 #if !PX_DOXYGEN
00277 }
00278 #endif
00279
00281 #endif //PX_VEHICLE_DRIVE_TANK_H