Lysa  0.0
Lysa 3D Engine
PhysXPhysicsEngine Class Reference

Detailed Description

PhysX implementation of PhysicsEngine. Responsible for creating scenes/materials and maintaining global PhysX state.

+ Inheritance diagram for PhysXPhysicsEngine:

Public Member Functions

 PhysXPhysicsEngine (const LayerCollisionTable &layerCollisionTable)
 
std::unique_ptr< PhysicsScenecreateScene (const DebugConfig &debugConfig) override
 
PhysicsMaterial * createMaterial (float friction=0.5f, float restitution=0.0f) const override
 
PhysicsMaterial * duplicateMaterial (const PhysicsMaterial *orig) const override
 
void setRestitutionCombineMode (PhysicsMaterial *physicsMaterial, CombineMode combineMode) const override
 
bool shouldCollide (const uint32_t layer1, const uint32_t layer2) const
 
auto getPhysics () const
 
 ~PhysXPhysicsEngine () override
 
- Public Member Functions inherited from PhysicsEngine
virtual ~PhysicsEngine () = default
 

Static Public Attributes

static bool collisionMatrix [MAX_COLLISIONS_LAYERS][MAX_COLLISIONS_LAYERS]
 

Additional Inherited Members

- Static Public Member Functions inherited from PhysicsEngine
static std::unique_ptr< PhysicsEngine > create (const PhysicsConfiguration &config)
 
static PhysicsEngineType getEngineType ()
 

Constructor & Destructor Documentation

PhysXPhysicsEngine ( const LayerCollisionTable layerCollisionTable)
~PhysXPhysicsEngine ( )
override

Destroys global PhysX state (foundation, physics, etc.).

Member Function Documentation

PhysicsMaterial* createMaterial ( float  friction = 0.5f,
float  restitution = 0.0f 
) const
overridevirtual

Creates a PhysX material with the provided coefficients.

Implements lysa::PhysicsEngine::createMaterial()

std::unique_ptr<PhysicsScene> createScene ( const DebugConfig debugConfig)
overridevirtual

Creates a new physics scene/world with optional debug settings.

Implements lysa::PhysicsEngine::createScene()

PhysicsMaterial* duplicateMaterial ( const PhysicsMaterial *  orig) const
overridevirtual

Returns a new PxMaterial with the same parameters as orig.

Implements lysa::PhysicsEngine::duplicateMaterial()

auto getPhysics ( ) const
inline

Returns the global PxPhysics object.

void setRestitutionCombineMode ( PhysicsMaterial *  physicsMaterial,
CombineMode  combineMode 
) const
overridevirtual

Sets how restitution is combined when two materials interact.

Implements lysa::PhysicsEngine::setRestitutionCombineMode()

bool shouldCollide ( const uint32_t  layer1,
const uint32_t  layer2 
) const
inline

Quick predicate using the precomputed collision matrix.

Member Data Documentation

bool collisionMatrix[MAX_COLLISIONS_LAYERS][MAX_COLLISIONS_LAYERS]
static