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

#include <PhysXSceneInterface.h>

+ Inheritance diagram for Divide::PhysXSceneInterface:

Public Member Functions

 PhysXSceneInterface (Scene &parentScene)
 
virtual ~PhysXSceneInterface () override
 
bool init () override
 Pre PHYSICS_DEVICE initialisation call.
 
bool isInit () const noexcept override
 Should return true if init() was called successfully.
 
void idle () override
 Custom physics idle calls.
 
void release () override
 Called on interface destruction.
 
void frameStarted (U64 deltaTimeGameUS) override
 Custom process step.
 
void frameEnded (U64 deltaTimeGameUS) override
 Physics update callback for custom behavior.
 
void addRigidActor (PhysXActor *actor)
 
void updateRigidActor (physx::PxRigidActor *oldActor, physx::PxRigidActor *newActor) const
 
physx::PxScene * getPhysXScene () const noexcept
 
bool intersect (const Ray &intersectionRay, vec2< F32 > range, vector< SGNRayResult > &intersectionsOut) const
 
- Public Member Functions inherited from Divide::PhysicsSceneInterface
 PhysicsSceneInterface (Scene &parentScene)
 
virtual bool init ()=0
 Pre PHYSICS_DEVICE initialisation call.
 
virtual bool isInit () const =0
 Should return true if init() was called successfully.
 
virtual void release ()=0
 Called on interface destruction.
 
virtual void idle ()=0
 Custom physics idle calls.
 
virtual void frameStarted (U64 deltaTimeGameUS)=0
 Custom process step.
 
virtual void frameEnded (U64 deltaTimeGameUS)=0
 Physics update callback for custom behavior.
 
- Public Member Functions inherited from Divide::SceneComponent
 SceneComponent (Scene &parentScene) noexcept
 
SceneparentScene () noexcept
 
const SceneparentScene () const noexcept
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 

Static Protected Member Functions

static void UpdateActor (physx::PxActor *actor)
 

Private Types

using LoadQueue = moodycamel::ConcurrentQueue< PhysXActor * >
 
using RigidMap = vector< PhysXActor * >
 

Private Attributes

physx::PxScene * _gScene = nullptr
 
physx::PxDefaultCpuDispatcher * _cpuDispatcher = nullptr
 
RigidMap _sceneRigidActors
 
std::atomic_bool _rigidActorsQueued {false}
 
std::atomic_bool _physxResultsPending {false}
 
LoadQueue _sceneRigidQueue
 

Additional Inherited Members

- Static Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 
- Protected Attributes inherited from Divide::SceneComponent
Scene_parentScene
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 

Detailed Description

Definition at line 49 of file PhysXSceneInterface.h.

Member Typedef Documentation

◆ LoadQueue

using Divide::PhysXSceneInterface::LoadQueue = moodycamel::ConcurrentQueue<PhysXActor*>
private

Definition at line 50 of file PhysXSceneInterface.h.

◆ RigidMap

Definition at line 73 of file PhysXSceneInterface.h.

Constructor & Destructor Documentation

◆ PhysXSceneInterface()

Divide::PhysXSceneInterface::PhysXSceneInterface ( Scene parentScene)

Definition at line 61 of file PhysXSceneInterface.cpp.

◆ ~PhysXSceneInterface()

Divide::PhysXSceneInterface::~PhysXSceneInterface ( )
overridevirtual

Definition at line 66 of file PhysXSceneInterface.cpp.

Member Function Documentation

◆ addRigidActor()

void Divide::PhysXSceneInterface::addRigidActor ( PhysXActor actor)

Definition at line 266 of file PhysXSceneInterface.cpp.

◆ frameEnded()

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

Physics update callback for custom behavior.

Implements Divide::PhysicsSceneInterface.

Definition at line 199 of file PhysXSceneInterface.cpp.

◆ frameStarted()

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

Custom process step.

Implements Divide::PhysicsSceneInterface.

Definition at line 255 of file PhysXSceneInterface.cpp.

◆ getPhysXScene()

physx::PxScene * Divide::PhysXSceneInterface::getPhysXScene ( ) const
inlinenoexcept

Definition at line 66 of file PhysXSceneInterface.h.

◆ idle()

void Divide::PhysXSceneInterface::idle ( )
overridevirtual

Custom physics idle calls.

Implements Divide::PhysicsSceneInterface.

Definition at line 168 of file PhysXSceneInterface.cpp.

◆ init()

bool Divide::PhysXSceneInterface::init ( )
overridevirtual

Pre PHYSICS_DEVICE initialisation call.

Implements Divide::PhysicsSceneInterface.

Definition at line 71 of file PhysXSceneInterface.cpp.

◆ intersect()

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

Definition at line 286 of file PhysXSceneInterface.cpp.

◆ isInit()

bool Divide::PhysXSceneInterface::isInit ( ) const
overridevirtualnoexcept

Should return true if init() was called successfully.

Implements Divide::PhysicsSceneInterface.

Definition at line 152 of file PhysXSceneInterface.cpp.

◆ release()

void Divide::PhysXSceneInterface::release ( )
overridevirtual

Called on interface destruction.

Implements Divide::PhysicsSceneInterface.

Definition at line 158 of file PhysXSceneInterface.cpp.

◆ UpdateActor()

void Divide::PhysXSceneInterface::UpdateActor ( physx::PxActor *  actor)
staticprotected

Definition at line 242 of file PhysXSceneInterface.cpp.

◆ updateRigidActor()

void Divide::PhysXSceneInterface::updateRigidActor ( physx::PxRigidActor *  oldActor,
physx::PxRigidActor *  newActor 
) const

Definition at line 274 of file PhysXSceneInterface.cpp.

Member Data Documentation

◆ _cpuDispatcher

physx::PxDefaultCpuDispatcher* Divide::PhysXSceneInterface::_cpuDispatcher = nullptr
private

Definition at line 75 of file PhysXSceneInterface.h.

◆ _gScene

physx::PxScene* Divide::PhysXSceneInterface::_gScene = nullptr
private

Definition at line 74 of file PhysXSceneInterface.h.

◆ _physxResultsPending

std::atomic_bool Divide::PhysXSceneInterface::_physxResultsPending {false}
private

Definition at line 79 of file PhysXSceneInterface.h.

◆ _rigidActorsQueued

std::atomic_bool Divide::PhysXSceneInterface::_rigidActorsQueued {false}
private

Definition at line 78 of file PhysXSceneInterface.h.

◆ _sceneRigidActors

RigidMap Divide::PhysXSceneInterface::_sceneRigidActors
private

Definition at line 76 of file PhysXSceneInterface.h.

◆ _sceneRigidQueue

LoadQueue Divide::PhysXSceneInterface::_sceneRigidQueue
private

Definition at line 81 of file PhysXSceneInterface.h.


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