Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::PhysX Class Referencefinal

#include <PhysX.h>

+ Inheritance diagram for Divide::PhysX:

Public Member Functions

 PhysX (PlatformContext &context)
 
ErrorCode initPhysicsAPI (U8 targetFrameRate, F32 simSpeed) override
 
bool closePhysicsAPI () override
 
void frameStarted (U64 deltaTimeGameUS) override
 Process results.
 
void frameEnded (U64 deltaTimeGameUS) override
 Update actors.
 
void idle () override
 
void updateTimeStep (U8 timeStepFactor, F32 simSpeed) override
 
bool initPhysicsScene (Scene &scene) override
 
bool destroyPhysicsScene (const Scene &scene) override
 
bool intersect (const Ray &intersectionRay, vec2< F32 > range, vector< SGNRayResult > &intersectionsOut) const override
 
physx::PxPhysics * getSDK () const noexcept
 
PhysicsAssetcreateRigidActor (SceneGraphNode *node, RigidBodyComponent &parentComp) override
 
bool convertActor (PhysicsAsset *actor, PhysicsGroup newGroup) override
 
void togglePvdConnection () const
 
void createPvdConnection (const char *ip, physx::PxU32 port, physx::PxU32 timeout, bool useFullConnection)
 
- Public Member Functions inherited from Divide::PhysicsAPIWrapper
 PhysicsAPIWrapper (PlatformContext &context)
 
virtual bool convertActor (PhysicsAsset *actor, PhysicsGroup newGroup)=0
 
- Public Member Functions inherited from Divide::PlatformContextComponent
 PlatformContextComponent (PlatformContext &context) noexcept
 
virtual ~PlatformContextComponent ()=default
 
PlatformContextcontext () noexcept
 
const PlatformContextcontext () const noexcept
 
- Public Member Functions inherited from Divide::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (NonCopyable &&)=default
 

Protected Member Functions

physx::PxRigidActor * createActorForGroup (PhysicsGroup group, const physx::PxTransform &pose)
 
virtual ErrorCode initPhysicsAPI (U8 targetFrameRate, F32 simSpeed)=0
 
virtual bool closePhysicsAPI ()=0
 
virtual void updateTimeStep (U8 timeStepFactor, F32 simSpeed)=0
 
virtual void idle ()=0
 
virtual bool initPhysicsScene (Scene &scene)=0
 
virtual bool destroyPhysicsScene (const Scene &scene)=0
 
virtual void frameStarted (const U64 deltaTimeGameUS)=0
 
virtual void frameEnded (const U64 deltaTimeGameUS)=0
 
virtual PhysicsAssetcreateRigidActor (SceneGraphNode *node, RigidBodyComponent &parentComp)=0
 
virtual bool intersect (const Ray &intersectionRay, vec2< F32 > range, vector< SGNRayResult > &intersectionsOut) const =0
 
- Protected Member Functions inherited from Divide::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 

Protected Attributes

PhysXSceneInterface_uptr _targetScene
 
- Protected Attributes inherited from Divide::PlatformContextComponent
PlatformContext_context
 

Private Attributes

F32 _simulationSpeed = 1.0f
 
physx::PxPhysics * _gPhysicsSDK = nullptr
 
physx::PxFoundation * _foundation = nullptr
 
physx::PxMaterial * _defaultMaterial = nullptr
 
physx::PxReal _timeStep = 0.0f
 
physx::PxU8 _timeStepFactor = 0
 
physx::PxReal _accumulator = 0.0f
 
physx::PxPvd * _pvd = nullptr
 
physx::PxPvdTransport * _transport = nullptr
 

Static Private Attributes

static SharedMutex s_meshCacheLock
 
static hashMap< U64, physx::PxTriangleMesh * > s_gMeshCache
 

Detailed Description

Definition at line 73 of file PhysX.h.

Constructor & Destructor Documentation

◆ PhysX()

Divide::PhysX::PhysX ( PlatformContext context)
explicit

Definition at line 133 of file PhysX.cpp.

Member Function Documentation

◆ closePhysicsAPI()

bool Divide::PhysX::closePhysicsAPI ( )
overridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 213 of file PhysX.cpp.

◆ convertActor()

bool Divide::PhysX::convertActor ( PhysicsAsset actor,
PhysicsGroup  newGroup 
)
overridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 599 of file PhysX.cpp.

◆ createActorForGroup()

physx::PxRigidActor * Divide::PhysX::createActorForGroup ( PhysicsGroup  group,
const physx::PxTransform &  pose 
)
protected

Definition at line 379 of file PhysX.cpp.

◆ createPvdConnection()

void Divide::PhysX::createPvdConnection ( const char *  ip,
physx::PxU32  port,
physx::PxU32  timeout,
bool  useFullConnection 
)

Definition at line 254 of file PhysX.cpp.

◆ createRigidActor()

PhysicsAsset * Divide::PhysX::createRigidActor ( SceneGraphNode node,
RigidBodyComponent parentComp 
)
overridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 403 of file PhysX.cpp.

◆ destroyPhysicsScene()

bool Divide::PhysX::destroyPhysicsScene ( const Scene scene)
overridevirtual

Destroy physics (:D)

Implements Divide::PhysicsAPIWrapper.

Definition at line 362 of file PhysX.cpp.

◆ frameEnded()

void Divide::PhysX::frameEnded ( U64  deltaTimeGameUS)
overridevirtual

Update actors.

Implements Divide::PhysicsAPIWrapper.

Definition at line 314 of file PhysX.cpp.

◆ frameStarted()

void Divide::PhysX::frameStarted ( U64  deltaTimeGameUS)
overridevirtual

Process results.

Implements Divide::PhysicsAPIWrapper.

Definition at line 295 of file PhysX.cpp.

◆ getSDK()

physx::PxPhysics * Divide::PhysX::getSDK ( ) const
inlinenoexcept

Definition at line 91 of file PhysX.h.

◆ idle()

void Divide::PhysX::idle ( )
overridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 323 of file PhysX.cpp.

◆ initPhysicsAPI()

ErrorCode Divide::PhysX::initPhysicsAPI ( U8  targetFrameRate,
F32  simSpeed 
)
overridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 138 of file PhysX.cpp.

◆ initPhysicsScene()

bool Divide::PhysX::initPhysicsScene ( Scene scene)
overridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 332 of file PhysX.cpp.

◆ intersect()

bool Divide::PhysX::intersect ( const Ray intersectionRay,
vec2< F32 range,
vector< SGNRayResult > &  intersectionsOut 
) const
overridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 626 of file PhysX.cpp.

◆ togglePvdConnection()

void Divide::PhysX::togglePvdConnection ( ) const

Definition at line 234 of file PhysX.cpp.

◆ updateTimeStep()

void Divide::PhysX::updateTimeStep ( U8  timeStepFactor,
F32  simSpeed 
)
inlineoverridevirtual

Implements Divide::PhysicsAPIWrapper.

Definition at line 286 of file PhysX.cpp.

Member Data Documentation

◆ _accumulator

physx::PxReal Divide::PhysX::_accumulator = 0.0f
private

Definition at line 113 of file PhysX.h.

◆ _defaultMaterial

physx::PxMaterial* Divide::PhysX::_defaultMaterial = nullptr
private

Definition at line 110 of file PhysX.h.

◆ _foundation

physx::PxFoundation* Divide::PhysX::_foundation = nullptr
private

Definition at line 109 of file PhysX.h.

◆ _gPhysicsSDK

physx::PxPhysics* Divide::PhysX::_gPhysicsSDK = nullptr
private

Definition at line 108 of file PhysX.h.

◆ _pvd

physx::PxPvd* Divide::PhysX::_pvd = nullptr
private

Definition at line 114 of file PhysX.h.

◆ _simulationSpeed

F32 Divide::PhysX::_simulationSpeed = 1.0f
private

Definition at line 107 of file PhysX.h.

◆ _targetScene

PhysXSceneInterface_uptr Divide::PhysX::_targetScene
protected

Definition at line 104 of file PhysX.h.

◆ _timeStep

physx::PxReal Divide::PhysX::_timeStep = 0.0f
private

Definition at line 111 of file PhysX.h.

◆ _timeStepFactor

physx::PxU8 Divide::PhysX::_timeStepFactor = 0
private

Definition at line 112 of file PhysX.h.

◆ _transport

physx::PxPvdTransport* Divide::PhysX::_transport = nullptr
private

Definition at line 115 of file PhysX.h.

◆ s_gMeshCache

hashMap< U64, physx::PxTriangleMesh * > Divide::PhysX::s_gMeshCache
staticprivate

Definition at line 118 of file PhysX.h.

◆ s_meshCacheLock

SharedMutex Divide::PhysX::s_meshCacheLock
staticprivate

Definition at line 117 of file PhysX.h.


The documentation for this class was generated from the following files: