Falcon
Namespaces | Classes | Enumerations | Functions
physics Namespace Reference

Namespaces

 vehicle
 

Classes

class  FLPxAllocator
 
class  FLPxErrorCallback
 
class  FLVehicleDrive4WRawInputData
 
class  RayCastManager
 

Enumerations

enum  PhysicsBodyType { PhysicsBodyType::ESTATIC_BODY, PhysicsBodyType::EDYNAMIC_BODY, PhysicsBodyType::EPLANE }
 
enum  PhysicsCollider { PhysicsCollider::ESPHERE_COLLIDER, PhysicsCollider::EBOX_COLLIDER, PhysicsCollider::ECAPSULE_COLLIDER }
 

Functions

physx::PxPhysics * GetPhysics ()
 
physx::PxScene * GetPhysicsScene ()
 
physx::PxCooking * GetCooking ()
 
physx::PxDefaultAllocator GetAllocator ()
 
physx::PxMaterial * GetDefaultMaterial ()
 
bool InitPhysX ()
 
void StepPhysics (float &dt, boost::container::vector< Entity *, fmemory::STLAllocator< Entity * >> *entity, const size_t &count)
 
void CreatePhysicsScene ()
 
bool ShutdownPhysX ()
 
physx::PxRigidStatic * CreatePlane ()
 
physx::PxRigidStatic * CreateStaticRigidActor (const Transform *transform, physx::PxShape *collider)
 
physx::PxRigidDynamic * CreateDynamicRigidActor (const Transform *transform, physx::PxShape *collider)
 
physx::PxRigidDynamic * CreateDynamicRigidActor ()
 
physx::PxShape * GetBoxCollider (const float &halfX, const float &halfY, const float &halfZ)
 
physx::PxShape * GetSphereCollider (const float &radius)
 
physx::PxShape * GetCapsuleCollider (const float &radius, const float &halfHeight)
 
physx::PxConvexMesh * GetConvexMesh (const glm::vec3 *vertexData, const int &stride, const int &vertCount, bool directInsert)
 
physx::PxShape * GetMeshCollider (const glm::vec3 *vertexData, const int &stride, const int &vertCount, bool directInsert)
 
physx::PxShape * GetExclusiveShape (physx::PxRigidActor *actor, const Transform *transform, const glm::vec3 *vertexData, const int &count, const int &stride)
 
void CreateCar (physx::PxRigidDynamic *vehActor, Transform &startTransform)
 
void ReleaseCollider (physx::PxRigidActor *ref)
 
template<typename T >
void ReleaseResource (T ref)
 

Enumeration Type Documentation

◆ PhysicsBodyType

This is an enum class specifying body type

Enumerator
ESTATIC_BODY 
EDYNAMIC_BODY 

< this is static body

EPLANE 

< this is dynamic body

◆ PhysicsCollider

This is an enum class specifying coillider shape

Enumerator
ESPHERE_COLLIDER 
EBOX_COLLIDER 

< Sphere collider

ECAPSULE_COLLIDER 

< Box collider

Function Documentation

◆ CreateCar()

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

Creates a vehicle using vehicle api. Which will be used for simulations later on.

Parameters
RigidDynamic*to the vehicle actor.
startingtransform for the vehicle.

◆ CreateDynamicRigidActor() [1/2]

physx::PxRigidDynamic * physics::CreateDynamicRigidActor ( )

Creates an empty rigid dynamic body which can be used to define multiple colliders.

◆ CreateDynamicRigidActor() [2/2]

physx::PxRigidDynamic * physics::CreateDynamicRigidActor ( const Transform transform,
physx::PxShape *  collider 
)

Creates Dynamic Rigid body.

Parameters
Transformof the entity.
Colliderfor the body.
Returns
Returns pointer to PxRigidDynamic actor nullptr on failure.

◆ CreatePhysicsScene()

void physics::CreatePhysicsScene ( )

Creates the physX scene.

◆ CreatePlane()

physx::PxRigidStatic * physics::CreatePlane ( )

Creats plane at origin with normal pointing to Y+ve. Soon will be updated to take in position.

◆ CreateStaticRigidActor()

physx::PxRigidStatic * physics::CreateStaticRigidActor ( const Transform transform,
physx::PxShape *  collider 
)

Creates Static Rigid body.

Parameters
Transformof the entity.
Colliderfor the body.
Returns
Returns pointer to PxRigidStatic actor.

◆ GetAllocator()

physx::PxDefaultAllocator physics::GetAllocator ( )

◆ GetBoxCollider()

physx::PxShape * physics::GetBoxCollider ( const float &  halfX,
const float &  halfY,
const float &  halfZ 
)

Creates box collider.

Parameters
floatindicating halfX
floatindicating halfY
floatindicating halfZ

◆ GetCapsuleCollider()

physx::PxShape * physics::GetCapsuleCollider ( const float &  radius,
const float &  halfHeight 
)

Creates capsule collider

Parameters
radiusof the top and bottom sphere
halfHeightof the capsule.
Returns
PxShape * for collider shape

◆ GetConvexMesh()

physx::PxConvexMesh * physics::GetConvexMesh ( const glm::vec3 *  vertexData,
const int &  stride,
const int &  vertCount,
bool  directInsert 
)

Createsconvext mesh for the collider

Parameters
vertexDatavertices of the mesh
stridethe length for each vertex
directInsertiondefines if mesh data should be streamed or not. Default value False.
Returns
PxConvexMesh for the

◆ GetCooking()

physx::PxCooking * physics::GetCooking ( )

◆ GetDefaultMaterial()

physx::PxMaterial * physics::GetDefaultMaterial ( )

◆ GetExclusiveShape()

physx::PxShape * physics::GetExclusiveShape ( physx::PxRigidActor *  actor,
const Transform transform,
const glm::vec3 *  vertexData,
const int &  count,
const int &  stride 
)

Creates an exclusive shape for the collider. Can be used to create a rigidbody with multiple colliders.

Parameters
pointerto rigidactor
pointerto the transform of entity
vertexDatavertices of the mesh
stridethe length for each vertex
countof the vertecies
Returns
PxShape * for collider shape which is associated to the actor provided

◆ GetMeshCollider()

physx::PxShape * physics::GetMeshCollider ( const glm::vec3 *  vertexData,
const int &  stride,
const int &  vertCount,
bool  directInsert 
)

Creates Mesh collider

Parameters
vertexDatavertices of the mesh
stridethe length for each vertex
countof the vertecies
directInsertiondefines if mesh data should be streamed or not. Default value False.
Returns
PxShape * for collider shape

◆ GetPhysics()

physx::PxPhysics * physics::GetPhysics ( )

◆ GetPhysicsScene()

physx::PxScene * physics::GetPhysicsScene ( )

◆ GetSphereCollider()

physx::PxShape * physics::GetSphereCollider ( const float &  radius)

Creates sphere collider

Parameters
radiusof the sphere
Returns
PxShape * for collider shape

◆ InitPhysX()

bool physics::InitPhysX ( )

◆ ReleaseCollider()

void physics::ReleaseCollider ( physx::PxRigidActor *  ref)

◆ ReleaseResource()

template<typename T >
void physics::ReleaseResource ( ref)

◆ ShutdownPhysX()

bool physics::ShutdownPhysX ( )

Shuts down the physX.

Returns
true is success. false on failure with error log.

◆ StepPhysics()

void physics::StepPhysics ( float &  dt,
boost::container::vector< Entity *, fmemory::STLAllocator< Entity * >> *  entity,
const size_t &  count 
)

Executes the physics simulation for dt.

Parameters
dttimedelta
vectorof entities with physics component on them
countof entities