PxVehicleDriveTank Class Reference
[Vehicle]
Data structure with instanced dynamics data and configuration data of a tank.
More...
#include <PxVehicleDriveTank.h>
Public Member Functions | |
void | free () |
Deallocate a PxVehicleDriveTank instance. | |
void | setup (PxPhysics *physics, PxRigidDynamic *vehActor, const PxVehicleWheelsSimData &wheelsData, const PxVehicleDriveSimData &driveData, const PxU32 nbDrivenWheels) |
Set up a tank using simulation data for the wheels and drive model. | |
void | setDriveModel (const PxVehicleDriveTankControlModel::Enum driveModel) |
Set the control model used by the tank. | |
PxVehicleDriveTankControlModel::Enum | getDriveModel () const |
Return the control model used by the tank. | |
void | setToRestState () |
Set a vehicle to its rest state. Aside from the rigid body transform, this will set the vehicle and rigid body to the state they were in immediately after setup or create. | |
PxVehicleDriveTank (PxBaseFlags baseFlags) | |
virtual const char * | getConcreteTypeName () const |
Returns string name of dynamic type. | |
virtual bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. | |
Static Public Member Functions | |
static PxVehicleDriveTank * | allocate (const PxU32 nbWheels) |
Allocate a PxVehicleTankDrive instance for a tank with nbWheels. | |
static PxVehicleDriveTank * | create (PxPhysics *physics, PxRigidDynamic *vehActor, const PxVehicleWheelsSimData &wheelsData, const PxVehicleDriveSimData &driveData, const PxU32 nbDrivenWheels) |
Allocate and set up a tank using simulation data for the wheels and drive model. | |
static PxVehicleDriveTank * | createObject (PxU8 *&address, PxDeserializationContext &context) |
static void | getBinaryMetaData (PxOutputStream &stream) |
Public Attributes | |
PxVehicleDriveSimData | mDriveSimData |
Simulation data that models vehicle components. | |
Protected Member Functions | |
PxVehicleDriveTank () | |
~PxVehicleDriveTank () | |
Private Member Functions | |
bool | isValid () const |
Test if the instanced dynamics and configuration data has legal values. | |
Private Attributes | |
PxVehicleDriveTankControlModel::Enum | mDriveModel |
Drive model. | |
PxU32 | mPad [3] |
Friends | |
class | PxVehicleUpdate |
Detailed Description
Data structure with instanced dynamics data and configuration data of a tank.Constructor & Destructor Documentation
PxVehicleDriveTank::PxVehicleDriveTank | ( | PxBaseFlags | baseFlags | ) | [inline] |
PxVehicleDriveTank::PxVehicleDriveTank | ( | ) | [protected] |
PxVehicleDriveTank::~PxVehicleDriveTank | ( | ) | [inline, protected] |
Member Function Documentation
static PxVehicleDriveTank* PxVehicleDriveTank::allocate | ( | const PxU32 | nbWheels | ) | [static] |
static PxVehicleDriveTank* PxVehicleDriveTank::create | ( | PxPhysics * | physics, | |
PxRigidDynamic * | vehActor, | |||
const PxVehicleWheelsSimData & | wheelsData, | |||
const PxVehicleDriveSimData & | driveData, | |||
const PxU32 | nbDrivenWheels | |||
) | [static] |
Allocate and set up a tank using simulation data for the wheels and drive model.
- Parameters:
-
[in] physics is a PxPhysics instance that is needed to create special vehicle constraints that are maintained by the tank. [in] vehActor is a PxRigidDynamic instance that is used to represent the tank in the PhysX SDK. [in] wheelsData describes the configuration of all suspension/tires/wheels of the tank. The tank instance takes a copy of this data. [in] driveData describes the properties of the tank's drive model (gears/engine/clutch/differential/autobox). The tank instance takes a copy of this data. [in] nbDrivenWheels is the number of wheels on the tank.
- Note:
- It is assumed that the first shapes of the actor are the wheel shapes, followed by the chassis shapes. To break this assumption use PxVehicleWheelsSimData::setWheelShapeMapping.
- Returns:
- The instantiated vehicle.
static PxVehicleDriveTank* PxVehicleDriveTank::createObject | ( | PxU8 *& | address, | |
PxDeserializationContext & | context | |||
) | [static] |
void PxVehicleDriveTank::free | ( | ) |
static void PxVehicleDriveTank::getBinaryMetaData | ( | PxOutputStream & | stream | ) | [static] |
Reimplemented from PxVehicleDrive.
virtual const char* PxVehicleDriveTank::getConcreteTypeName | ( | ) | const [inline, virtual] |
Returns string name of dynamic type.
- Returns:
- Class name of most derived type of this object.
Reimplemented from PxVehicleDrive.
PxVehicleDriveTankControlModel::Enum PxVehicleDriveTank::getDriveModel | ( | ) | const [inline] |
Return the control model used by the tank.
virtual bool PxVehicleDriveTank::isKindOf | ( | const char * | superClass | ) | const [inline, virtual] |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxVehicleDrive.
References PxBase::isKindOf().
bool PxVehicleDriveTank::isValid | ( | ) | const [private] |
Test if the instanced dynamics and configuration data has legal values.
Reimplemented from PxVehicleDrive.
void PxVehicleDriveTank::setDriveModel | ( | const PxVehicleDriveTankControlModel::Enum | driveModel | ) | [inline] |
Set the control model used by the tank.
- Note:
- eDRIVE_MODEL_STANDARD: turning achieved by braking on one side, accelerating on the other side.
eDRIVE_MODEL_SPECIAL: turning achieved by accelerating forwards on one side, accelerating backwards on the other side.
The default value is eDRIVE_MODEL_STANDARD
void PxVehicleDriveTank::setToRestState | ( | ) |
Set a vehicle to its rest state. Aside from the rigid body transform, this will set the vehicle and rigid body to the state they were in immediately after setup or create.
- Note:
- Calling setToRestState invalidates the cached raycast hit planes under each wheel meaning that suspension line raycasts need to be performed at least once with PxVehicleSuspensionRaycasts before calling PxVehicleUpdates.
- See also:
- setup, create, PxVehicleSuspensionRaycasts, PxVehicleUpdates
Reimplemented from PxVehicleDrive.
void PxVehicleDriveTank::setup | ( | PxPhysics * | physics, | |
PxRigidDynamic * | vehActor, | |||
const PxVehicleWheelsSimData & | wheelsData, | |||
const PxVehicleDriveSimData & | driveData, | |||
const PxU32 | nbDrivenWheels | |||
) |
Set up a tank using simulation data for the wheels and drive model.
- Parameters:
-
[in] physics is a PxPhysics instance that is needed to create special vehicle constraints that are maintained by the vehicle. [in] vehActor is a PxRigidDynamic instance that is used to represent the tank in the PhysX SDK. [in] wheelsData describes the configuration of all suspension/tires/wheels of the tank. The tank instance takes a copy of this data. [in] driveData describes the properties of the tank's drive model (gears/engine/clutch/autobox). The tank instance takes a copy of this data. [in] nbDrivenWheels is the number of wheels on the tank.
- Note:
- It is assumed that the first shapes of the actor are the wheel shapes, followed by the chassis shapes. To break this assumption use PxVehicleWheelsSimData::setWheelShapeMapping.
- Note:
- nbDrivenWheels must be an even number
The wheels must be arranged according to PxVehicleDriveTankWheelOrder; that is, the even wheels are on the left side of the tank and the odd wheels are on the right side of the tank.
Friends And Related Function Documentation
friend class PxVehicleUpdate [friend] |
Reimplemented from PxVehicleDrive.
Member Data Documentation
PxU32 PxVehicleDriveTank::mPad[3] [private] |
Reimplemented from PxVehicleWheels.
The documentation for this class was generated from the following file:
Copyright © 2008-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com