Falcon
Namespaces | Classes | Enumerations | Functions | Variables
physics::vehicle Namespace Reference

Namespaces

 car_data
 

Classes

struct  ActorUserData
 
struct  Car
 
struct  ShapeUserData
 
struct  VehicleDesc
 
class  VehicleSceneQueryData
 
class  WheelQueryResults
 

Enumerations

enum  COLLUSUION_FLAGS {
  COLLISION_FLAG_GROUND = 1 << 0, COLLISION_FLAG_WHEEL = 1 << 1, COLLISION_FLAG_CHASSIS = 1 << 2, COLLISION_FLAG_OBSTACLE = 1 << 3,
  COLLISION_FLAG_DRIVABLE_OBSTACLE = 1 << 4, COLLISION_FLAG_GROUND_AGAINST = COLLISION_FLAG_CHASSIS | COLLISION_FLAG_OBSTACLE | COLLISION_FLAG_DRIVABLE_OBSTACLE, COLLISION_FLAG_WHEEL_AGAINST = COLLISION_FLAG_WHEEL | COLLISION_FLAG_CHASSIS | COLLISION_FLAG_OBSTACLE, COLLISION_FLAG_CHASSIS_AGAINST = COLLISION_FLAG_GROUND | COLLISION_FLAG_WHEEL | COLLISION_FLAG_CHASSIS | COLLISION_FLAG_OBSTACLE | COLLISION_FLAG_DRIVABLE_OBSTACLE,
  COLLISION_FLAG_OBSTACLE_AGAINST = COLLISION_FLAG_GROUND | COLLISION_FLAG_WHEEL | COLLISION_FLAG_CHASSIS | COLLISION_FLAG_OBSTACLE | COLLISION_FLAG_DRIVABLE_OBSTACLE, COLLISION_FLAG_DRIVABLE_OBSTACLE_AGAINST = COLLISION_FLAG_GROUND | COLLISION_FLAG_CHASSIS | COLLISION_FLAG_OBSTACLE | COLLISION_FLAG_DRIVABLE_OBSTACLE
}
 
enum  { DRIVABLE_SURFACE = 0xffff0000, UNDRIVABLE_SURFACE = 0x0000ffff }
 

Functions

void IncrementDrivingMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData, const float timestep)
 
void CreateVehicleDescriptionObject (Car *car)
 
void CreateVehicle4W (Car *car, physx::PxRigidDynamic *vehActor)
 
void SetupVehicleActorData (Car *car, physx::PxRigidDynamic *vehActor)
 
void ConfigureCarData (physx::PxVehicleWheels *vehicle, ActorUserData *actorUserData, ShapeUserData *shapeUserDatas)
 
void startAccelerateForwardsMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
void startAccelerateReverseMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
void startBrakeMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
void startTurnHardLeftMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
void startTurnHardRightMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
void startHandbrakeTurnLeftMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
void startHandbrakeTurnRightMode (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
void releaseAllControls (Car *car, physx::PxVehicleDrive4WRawInputData &vehicleInputData)
 
bool InitVehicleSDK ()
 
bool ReleaseVehcileSDK ()
 
void StepVehicleSDK (float dt)
 
physx::PxVehicleDrivableSurfaceToTireFrictionPairs * createFrictionPairs (const physx::PxMaterial *defaultMaterial)
 
void CreateCar (physx::PxRigidDynamic *vehActor, Transform &transform)
 
void ReleaseCarMemory ()
 
physx::PxFilterFlags VehicleFilterShader (physx::PxFilterObjectAttributes attributes0, physx::PxFilterData filterData0, physx::PxFilterObjectAttributes attributes1, physx::PxFilterData filterData1, physx::PxPairFlags &pairFlags, const void *constantBlock, uint32_t constantBlockSize)
 
void setupDrivableSurface (physx::PxFilterData &filterData)
 
void setupNonDrivableSurface (physx::PxFilterData &filterData)
 
physx::PxQueryHitType::Enum WheelSceneQueryPreFilterBlocking (physx::PxFilterData filterData0, physx::PxFilterData filterData1, const void *constantBlock, uint32_t constantBlockSize, physx::PxHitFlags &queryFlags)
 
physx::PxQueryHitType::Enum WheelSceneQueryPostFilterBlocking (physx::PxFilterData filterData0, physx::PxFilterData filterData1, const void *constantBlock, uint32_t constantBlockSize, const physx::PxQueryHit &hit)
 
physx::PxQueryHitType::Enum WheelSceneQueryPreFilterNonBlocking (physx::PxFilterData filterData0, physx::PxFilterData filterData1, const void *constantBlock, uint32_t constantBlockSize, physx::PxHitFlags &queryFlags)
 
physx::PxQueryHitType::Enum WheelSceneQueryPostFilterNonBlocking (physx::PxFilterData filterData0, physx::PxFilterData filterData1, const void *constantBlock, uint32_t constantBlockSize, const physx::PxQueryHit &hit)
 
physx::PxQueryHitType::Enum WheelSceneQueryPreFilterNonBlocking (physx::PxFilterData filterData0, physx::PxFilterData filterData1, const void *constantBlock, uint32_t constantBlockSize, const physx::PxHitFlags &queryFlags)
 

Variables

boost::container::vector< Car * > gCars
 
physx::PxVehicleDrive4WRawInputData gVehicleInputData [10]
 
boost::container::vector< physx::PxVehicleWheels * > gVehicles
 
boost::container::vector< physx::PxVehicleWheelQueryResult > gvehicleQueryResults
 
bool gMimicKeyInputs = true
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DRIVABLE_SURFACE 
UNDRIVABLE_SURFACE 

◆ COLLUSUION_FLAGS

Defines the different collision flags for defining colliding surfaces.

Enumerator
COLLISION_FLAG_GROUND 
COLLISION_FLAG_WHEEL 
COLLISION_FLAG_CHASSIS 
COLLISION_FLAG_OBSTACLE 
COLLISION_FLAG_DRIVABLE_OBSTACLE 
COLLISION_FLAG_GROUND_AGAINST 
COLLISION_FLAG_WHEEL_AGAINST 
COLLISION_FLAG_CHASSIS_AGAINST 
COLLISION_FLAG_OBSTACLE_AGAINST 
COLLISION_FLAG_DRIVABLE_OBSTACLE_AGAINST 

Function Documentation

◆ ConfigureCarData()

void physics::vehicle::ConfigureCarData ( physx::PxVehicleWheels *  vehicle,
ActorUserData actorUserData,
ShapeUserData shapeUserDatas 
)

Defines the car for the vehicle sdk.

Parameters
PxVehicleWheels*to vehicle
ActorUserData*being used for simulation
ShapeUserData*being used for collision

◆ CreateCar()

void physics::vehicle::CreateCar ( physx::PxRigidDynamic *  vehActor,
Transform transform 
)

Car Creation API

Parameters
Rigiddynamic*to the actor
startingtransform for the car

Car creation/Deletion API

◆ createFrictionPairs()

physx::PxVehicleDrivableSurfaceToTireFrictionPairs * physics::vehicle::createFrictionPairs ( const physx::PxMaterial *  defaultMaterial)

Creates the firction pairs for the tyre materials and terrain surfaces. Will be used by the simulation.

Parameters
materialpointer for default material
Returns
pointer to data structure holding Surface to tire friction pairs.

◆ CreateVehicle4W()

void physics::vehicle::CreateVehicle4W ( Car car,
physx::PxRigidDynamic *  vehActor 
)

Creates vehicle4w* for a car which is used by physx to apply simulations on.

Parameters
poniterto the car which is being setup
pointerto car's dynamic actor

◆ CreateVehicleDescriptionObject()

void physics::vehicle::CreateVehicleDescriptionObject ( Car car)

This method can be used to setup the vehicle description.

Parameters
poniterto the car which is being setup TODO: Read data from json.

The API which exposes the vehicle creation for the external classes to create cars to create and use cars in scenes. Steps to instantiate a car

  1. Setup wheel data
  2. Setup DriveSimulation data
  3. Adds cars to the

◆ IncrementDrivingMode()

void physics::vehicle::IncrementDrivingMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData,
const float  timestep 
)

Nvidia'a Sample code to itereate through multiple driving routines. Being used here for testing. Will be removed once we have inputs coming in via Falcon's APIs.

◆ InitVehicleSDK()

bool physics::vehicle::InitVehicleSDK ( )

Initializes the physx vehicle sdk.

Returns
true if success,false otherwise.

Initiates the vehicle sdk for the physics.

◆ releaseAllControls()

void physics::vehicle::releaseAllControls ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Releases all inouts from the car.

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

◆ ReleaseCarMemory()

void physics::vehicle::ReleaseCarMemory ( )

Releases the memory being used by the car objects.

◆ ReleaseVehcileSDK()

bool physics::vehicle::ReleaseVehcileSDK ( )

Releases resources being held physx vehicle sdk.

Returns
true if success,false otherwise.

Releases resources allocated by the vehicle sdk.

◆ setupDrivableSurface()

void physics::vehicle::setupDrivableSurface ( physx::PxFilterData &  filterData)

◆ setupNonDrivableSurface()

void physics::vehicle::setupNonDrivableSurface ( physx::PxFilterData &  filterData)

◆ SetupVehicleActorData()

void physics::vehicle::SetupVehicleActorData ( Car car,
physx::PxRigidDynamic *  vehActor 
)

Sets up simulation data for wheels and chassis.

Parameters
poniterto the car which is being setup
pointerto car's dynamic actor

◆ startAccelerateForwardsMode()

void physics::vehicle::startAccelerateForwardsMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Drives the car forward.

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

Methods to pass on inuts to phyX.

◆ startAccelerateReverseMode()

void physics::vehicle::startAccelerateReverseMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Drives the car backwards.

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

◆ startBrakeMode()

void physics::vehicle::startBrakeMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Applies breaks to the car.

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

◆ startHandbrakeTurnLeftMode()

void physics::vehicle::startHandbrakeTurnLeftMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Makes car take a left turn with handbreak enabled

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

◆ startHandbrakeTurnRightMode()

void physics::vehicle::startHandbrakeTurnRightMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Makes car take a right turn with handbreak enabled.

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

◆ startTurnHardLeftMode()

void physics::vehicle::startTurnHardLeftMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Makes car take a hard left turn

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

◆ startTurnHardRightMode()

void physics::vehicle::startTurnHardRightMode ( Car car,
physx::PxVehicleDrive4WRawInputData &  vehicleInputData 
)

Makes car take a hard right turn.

Parameters
pointerto the car.
PxVehicleDrive4WRawInputDataassociated with the car.

◆ StepVehicleSDK()

void physics::vehicle::StepVehicleSDK ( float  dt)

Handles simulation setup for the vehicles in the scene.

Parameters
timedelta

Vehicle Update

◆ VehicleFilterShader()

physx::PxFilterFlags physics::vehicle::VehicleFilterShader ( physx::PxFilterObjectAttributes  attributes0,
physx::PxFilterData  filterData0,
physx::PxFilterObjectAttributes  attributes1,
physx::PxFilterData  filterData1,
physx::PxPairFlags &  pairFlags,
const void *  constantBlock,
uint32_t  constantBlockSize 
)

Creates a vehicle filter shader which enables physx to decide what stuff car should interact with.

◆ WheelSceneQueryPostFilterBlocking()

physx::PxQueryHitType::Enum physics::vehicle::WheelSceneQueryPostFilterBlocking ( physx::PxFilterData  filterData0,
physx::PxFilterData  filterData1,
const void *  constantBlock,
uint32_t  constantBlockSize,
const physx::PxQueryHit &  hit 
)

◆ WheelSceneQueryPostFilterNonBlocking()

physx::PxQueryHitType::Enum physics::vehicle::WheelSceneQueryPostFilterNonBlocking ( physx::PxFilterData  filterData0,
physx::PxFilterData  filterData1,
const void *  constantBlock,
uint32_t  constantBlockSize,
const physx::PxQueryHit &  hit 
)

◆ WheelSceneQueryPreFilterBlocking()

physx::PxQueryHitType::Enum physics::vehicle::WheelSceneQueryPreFilterBlocking ( physx::PxFilterData  filterData0,
physx::PxFilterData  filterData1,
const void *  constantBlock,
uint32_t  constantBlockSize,
physx::PxHitFlags &  queryFlags 
)

◆ WheelSceneQueryPreFilterNonBlocking() [1/2]

physx::PxQueryHitType::Enum physics::vehicle::WheelSceneQueryPreFilterNonBlocking ( physx::PxFilterData  filterData0,
physx::PxFilterData  filterData1,
const void *  constantBlock,
uint32_t  constantBlockSize,
const physx::PxHitFlags &  queryFlags 
)

◆ WheelSceneQueryPreFilterNonBlocking() [2/2]

physx::PxQueryHitType::Enum physics::vehicle::WheelSceneQueryPreFilterNonBlocking ( physx::PxFilterData  filterData0,
physx::PxFilterData  filterData1,
const void *  constantBlock,
uint32_t  constantBlockSize,
physx::PxHitFlags &  queryFlags 
)

Variable Documentation

◆ gCars

boost::container::vector< Car * > physics::vehicle::gCars

Global vec to maintain all cars' Driver4W component. This is used by vehicle update to update all the cars. As custom allocators are not initialized before these allocations, I am using default allocators.

◆ gMimicKeyInputs

bool physics::vehicle::gMimicKeyInputs = true

◆ gVehicleInputData

physx::PxVehicleDrive4WRawInputData physics::vehicle::gVehicleInputData

◆ gvehicleQueryResults

boost::container::vector< physx::PxVehicleWheelQueryResult > physics::vehicle::gvehicleQueryResults

◆ gVehicles

boost::container::vector< physx::PxVehicleWheels * > physics::vehicle::gVehicles