Falcon
Functions | Variables
physics::vehicle::car_data Namespace Reference

Functions

const physx::PxVec3 CHASSIS_DIMS (2.5f, 2.0f, 5.0f)
 
const physx::PxVec3 CHASSIS_MOI ((CHASSIS_DIMS.y *CHASSIS_DIMS.y+CHASSIS_DIMS.z *CHASSIS_DIMS.z) *CHASSIS_MASS/12.0f,(CHASSIS_DIMS.x *CHASSIS_DIMS.x+CHASSIS_DIMS.z *CHASSIS_DIMS.z) *0.8f *CHASSIS_MASS/12.0f,(CHASSIS_DIMS.x *CHASSIS_DIMS.x+CHASSIS_DIMS.y *CHASSIS_DIMS.y) *CHASSIS_MASS/12.0f)
 
const physx::PxVec3 CHASSIS_CM_OFFSET (0.0f, -CHASSIS_DIMS.y *0.5f+0.65f, 0.25f)
 
const physx::PxMeshScale SCALE_DOWN (physx::PxVec3(0.01, 0.01, 0.01), physx::PxQuat(0, 0, 0, 1))
 
void ComputeWheelCenterActorOffsets4W (const float wheelFrontZ, const float wheelRearZ, const physx::PxVec3 &chassisDims, const float wheelWidth, const float wheelRadius, const float numWheels, physx::PxVec3 *wheelCentreOffsets)
 
void SetupWheelsSimulationData (const float wheelMass, const float wheelMOI, const float wheelRadius, const float wheelWidth, const uint32_t numWheels, const physx::PxVec3 *wheelCenterActorOffsets, const physx::PxVec3 &chassisCMOffset, const float chassisMass, physx::PxVehicleWheelsSimData *wheelsSimData)
 

Variables

const float CHASSIS_MASS = 1500.0f
 
const float WHEEL_MASS = 20.0f
 
const float WHEEL_RADIUS = 0.5f
 
const float WHEEL_WIDTH = 0.4f
 
const float WHEEL_MOI = 0.5f * WHEEL_MASS * WHEEL_RADIUS * WHEEL_RADIUS
 
const float NUMBER_OF_WHEELS = 4
 

Function Documentation

◆ CHASSIS_CM_OFFSET()

const physx::PxVec3 physics::vehicle::car_data::CHASSIS_CM_OFFSET ( 0.  0f,
-CHASSIS_DIMS.y *0.5f+0.  65f,
0.  25f 
)

◆ CHASSIS_DIMS()

const physx::PxVec3 physics::vehicle::car_data::CHASSIS_DIMS ( 2.  5f,
2.  0f,
5.  0f 
)

◆ CHASSIS_MOI()

const physx::PxVec3 physics::vehicle::car_data::CHASSIS_MOI ( (CHASSIS_DIMS.y *CHASSIS_DIMS.y+CHASSIS_DIMS.z *CHASSIS_DIMS.z) *CHASSIS_MASS/12.  0f,
(CHASSIS_DIMS.x *CHASSIS_DIMS.x+CHASSIS_DIMS.z *CHASSIS_DIMS.z) *0.8f *CHASSIS_MASS/12.  0f,
(CHASSIS_DIMS.x *CHASSIS_DIMS.x+CHASSIS_DIMS.y *CHASSIS_DIMS.y) *CHASSIS_MASS/12.  0f 
)

◆ ComputeWheelCenterActorOffsets4W()

void physics::vehicle::car_data::ComputeWheelCenterActorOffsets4W ( const float  wheelFrontZ,
const float  wheelRearZ,
const physx::PxVec3 &  chassisDims,
const float  wheelWidth,
const float  wheelRadius,
const float  numWheels,
physx::PxVec3 *  wheelCentreOffsets 
)

Helper method to calculate the Center offset. Required for car, but doesn't need to be in Car class.

◆ SCALE_DOWN()

const physx::PxMeshScale physics::vehicle::car_data::SCALE_DOWN ( physx::PxVec3(0.01, 0.01, 0.01)  ,
physx::PxQuat(0, 0, 0, 1)   
)

◆ SetupWheelsSimulationData()

void physics::vehicle::car_data::SetupWheelsSimulationData ( const float  wheelMass,
const float  wheelMOI,
const float  wheelRadius,
const float  wheelWidth,
const uint32_t  numWheels,
const physx::PxVec3 *  wheelCenterActorOffsets,
const physx::PxVec3 &  chassisCMOffset,
const float  chassisMass,
physx::PxVehicleWheelsSimData *  wheelsSimData 
)

Helper method to setup Wheel simulation data.

Variable Documentation

◆ CHASSIS_MASS

const float physics::vehicle::car_data::CHASSIS_MASS = 1500.0f

Some default values for the car creation. Not for final game. Set up the chassis mass, dimensions, moment of inertia, and center of mass offset. The moment of inertia is just the moment of inertia of a cuboid but modified for easier steering. Center of mass offset is 0.65m above the base of the chassis and 0.25m towards the front.

◆ NUMBER_OF_WHEELS

const float physics::vehicle::car_data::NUMBER_OF_WHEELS = 4

◆ WHEEL_MASS

const float physics::vehicle::car_data::WHEEL_MASS = 20.0f

◆ WHEEL_MOI

const float physics::vehicle::car_data::WHEEL_MOI = 0.5f * WHEEL_MASS * WHEEL_RADIUS * WHEEL_RADIUS

◆ WHEEL_RADIUS

const float physics::vehicle::car_data::WHEEL_RADIUS = 0.5f

◆ WHEEL_WIDTH

const float physics::vehicle::car_data::WHEEL_WIDTH = 0.4f