Foundation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Foundation::Examples::JoltGPUScene Class Reference

#include <JoltGPUScene.hpp>

Classes

struct  LightSlot
 
struct  MaterialSlot
 
struct  Object
 

Public Member Functions

 JoltGPUScene (RHIDevice *device, Core::JobSystem *jobs, JoltGPUSceneDesc const &desc={}, Core::Allocator *allocator=GLOBAL_ALLOC)
 
 ~JoltGPUScene ()
 
 JoltGPUScene (JoltGPUScene const &)=delete
 
JoltGPUSceneoperator= (JoltGPUScene const &)=delete
 
GPUSceneGetGPUScene ()
 
GPUScene const & GetGPUScene () const
 
GPUScene::Result Upload (FImportedMesh const &source, GeometryHandle &outHandle)
 
void Join ()
 
PhysicsStatus CreateShape (PhysicsShapeDesc const &desc, PhysicsShapeHandle &outHandle)
 
PhysicsStatus DestroyShape (PhysicsShapeHandle handle)
 
PhysicsStatus CreateMaterial (GSMaterial const &material, GPUSceneMaterialHandle &outHandle)
 
PhysicsStatus SetMaterial (GPUSceneMaterialHandle handle, GSMaterial const &material)
 
PhysicsStatus DestroyMaterial (GPUSceneMaterialHandle handle)
 
PhysicsStatus CreateLight (GSLight const &light, GPUSceneLightHandle &outHandle)
 
PhysicsStatus SetLight (GPUSceneLightHandle handle, GSLight const &light)
 
PhysicsStatus DestroyLight (GPUSceneLightHandle handle)
 
PhysicsStatus Spawn (PhysicsBodyDesc const &bodyDesc, PhysicsVisualDesc const &visualDesc, PhysicsBodyHandle &outBody)
 
PhysicsStatus Destroy (PhysicsBodyHandle body)
 
bool IsBodyValid (PhysicsBodyHandle handle) const
 
PhysicsStatus SetObjectMaterial (PhysicsBodyHandle body, GPUSceneMaterialHandle material)
 
PhysicsStatus RayCast (PhysicsRayDesc const &ray, PhysicsRayHit &outHit) const
 
PhysicsStatus GetBodyPose (PhysicsBodyHandle body, PhysicsBodyPose &outPose) const
 
PhysicsStatus SetBodyPose (PhysicsBodyHandle body, PhysicsBodyPose const &pose, PhysicsActivation activation=PhysicsActivation::Activate)
 
PhysicsStatus SetLinearVelocity (PhysicsBodyHandle body, float3 const &velocity)
 
PhysicsStatus Step (float deltaSeconds, int collisionSteps=1)
 
PhysicsStatus Commit (RendererUBO &ubo)
 
uint32_t GetObjectCount () const
 
uint32_t GetBodyCount () const
 
uint32_t GetMaxBodies () const
 

Private Member Functions

MaterialSlotResolveMaterial (GPUSceneMaterialHandle handle)
 
MaterialSlot const * ResolveMaterial (GPUSceneMaterialHandle handle) const
 
LightSlotResolveLight (GPUSceneLightHandle handle)
 
void MarkBroadPhaseDirty ()
 

Private Attributes

JoltPhysicsWorld mWorld
 
GPUScene mGPU
 
Core::Vector< MaterialSlotmMaterials
 
Core::Vector< LightSlotmLights
 
Core::Vector< ObjectmObjects
 
Core::Vector< uint32_t > mFreeMaterials
 
Core::Vector< uint32_t > mFreeLights
 
bool mBroadPhaseDirty {false}
 

Constructor & Destructor Documentation

◆ JoltGPUScene() [1/2]

Foundation::Examples::JoltGPUScene::JoltGPUScene ( RHIDevice device,
Core::JobSystem jobs,
JoltGPUSceneDesc const &  desc = {},
Core::Allocator allocator = GLOBAL_ALLOC 
)

◆ ~JoltGPUScene()

Foundation::Examples::JoltGPUScene::~JoltGPUScene ( )

◆ JoltGPUScene() [2/2]

Foundation::Examples::JoltGPUScene::JoltGPUScene ( JoltGPUScene const &  )
delete

Member Function Documentation

◆ Commit()

PhysicsStatus Foundation::Examples::JoltGPUScene::Commit ( RendererUBO ubo)

◆ CreateLight()

PhysicsStatus Foundation::Examples::JoltGPUScene::CreateLight ( GSLight const &  light,
GPUSceneLightHandle outHandle 
)

◆ CreateMaterial()

PhysicsStatus Foundation::Examples::JoltGPUScene::CreateMaterial ( GSMaterial const &  material,
GPUSceneMaterialHandle outHandle 
)

◆ CreateShape()

PhysicsStatus Foundation::Examples::JoltGPUScene::CreateShape ( PhysicsShapeDesc const &  desc,
PhysicsShapeHandle outHandle 
)

◆ Destroy()

PhysicsStatus Foundation::Examples::JoltGPUScene::Destroy ( PhysicsBodyHandle  body)

◆ DestroyLight()

PhysicsStatus Foundation::Examples::JoltGPUScene::DestroyLight ( GPUSceneLightHandle  handle)

◆ DestroyMaterial()

PhysicsStatus Foundation::Examples::JoltGPUScene::DestroyMaterial ( GPUSceneMaterialHandle  handle)

◆ DestroyShape()

PhysicsStatus Foundation::Examples::JoltGPUScene::DestroyShape ( PhysicsShapeHandle  handle)

◆ GetBodyCount()

uint32_t Foundation::Examples::JoltGPUScene::GetBodyCount ( ) const
inline

◆ GetBodyPose()

PhysicsStatus Foundation::Examples::JoltGPUScene::GetBodyPose ( PhysicsBodyHandle  body,
PhysicsBodyPose outPose 
) const

◆ GetGPUScene() [1/2]

GPUScene & Foundation::Examples::JoltGPUScene::GetGPUScene ( )
inline

◆ GetGPUScene() [2/2]

GPUScene const & Foundation::Examples::JoltGPUScene::GetGPUScene ( ) const
inline

◆ GetMaxBodies()

uint32_t Foundation::Examples::JoltGPUScene::GetMaxBodies ( ) const
inline

◆ GetObjectCount()

uint32_t Foundation::Examples::JoltGPUScene::GetObjectCount ( ) const
inline

◆ IsBodyValid()

bool Foundation::Examples::JoltGPUScene::IsBodyValid ( PhysicsBodyHandle  handle) const

◆ Join()

void Foundation::Examples::JoltGPUScene::Join ( )

◆ MarkBroadPhaseDirty()

void Foundation::Examples::JoltGPUScene::MarkBroadPhaseDirty ( )
private

◆ operator=()

JoltGPUScene & Foundation::Examples::JoltGPUScene::operator= ( JoltGPUScene const &  )
delete

◆ RayCast()

PhysicsStatus Foundation::Examples::JoltGPUScene::RayCast ( PhysicsRayDesc const &  ray,
PhysicsRayHit outHit 
) const

◆ ResolveLight()

JoltGPUScene::LightSlot * Foundation::Examples::JoltGPUScene::ResolveLight ( GPUSceneLightHandle  handle)
private

◆ ResolveMaterial() [1/2]

JoltGPUScene::MaterialSlot * Foundation::Examples::JoltGPUScene::ResolveMaterial ( GPUSceneMaterialHandle  handle)
private

◆ ResolveMaterial() [2/2]

JoltGPUScene::MaterialSlot const * Foundation::Examples::JoltGPUScene::ResolveMaterial ( GPUSceneMaterialHandle  handle) const
private

◆ SetBodyPose()

PhysicsStatus Foundation::Examples::JoltGPUScene::SetBodyPose ( PhysicsBodyHandle  body,
PhysicsBodyPose const &  pose,
PhysicsActivation  activation = PhysicsActivation::Activate 
)

◆ SetLight()

PhysicsStatus Foundation::Examples::JoltGPUScene::SetLight ( GPUSceneLightHandle  handle,
GSLight const &  light 
)

◆ SetLinearVelocity()

PhysicsStatus Foundation::Examples::JoltGPUScene::SetLinearVelocity ( PhysicsBodyHandle  body,
float3 const &  velocity 
)

◆ SetMaterial()

PhysicsStatus Foundation::Examples::JoltGPUScene::SetMaterial ( GPUSceneMaterialHandle  handle,
GSMaterial const &  material 
)

◆ SetObjectMaterial()

PhysicsStatus Foundation::Examples::JoltGPUScene::SetObjectMaterial ( PhysicsBodyHandle  body,
GPUSceneMaterialHandle  material 
)

◆ Spawn()

PhysicsStatus Foundation::Examples::JoltGPUScene::Spawn ( PhysicsBodyDesc const &  bodyDesc,
PhysicsVisualDesc const &  visualDesc,
PhysicsBodyHandle outBody 
)

◆ Step()

PhysicsStatus Foundation::Examples::JoltGPUScene::Step ( float  deltaSeconds,
int  collisionSteps = 1 
)

◆ Upload()

GPUScene::Result Foundation::Examples::JoltGPUScene::Upload ( FImportedMesh const &  source,
GeometryHandle outHandle 
)

Member Data Documentation

◆ mBroadPhaseDirty

bool Foundation::Examples::JoltGPUScene::mBroadPhaseDirty {false}
private

◆ mFreeLights

Core::Vector<uint32_t> Foundation::Examples::JoltGPUScene::mFreeLights
private

◆ mFreeMaterials

Core::Vector<uint32_t> Foundation::Examples::JoltGPUScene::mFreeMaterials
private

◆ mGPU

GPUScene Foundation::Examples::JoltGPUScene::mGPU
private

◆ mLights

Core::Vector<LightSlot> Foundation::Examples::JoltGPUScene::mLights
private

◆ mMaterials

Core::Vector<MaterialSlot> Foundation::Examples::JoltGPUScene::mMaterials
private

◆ mObjects

Core::Vector<Object> Foundation::Examples::JoltGPUScene::mObjects
private

◆ mWorld

JoltPhysicsWorld Foundation::Examples::JoltGPUScene::mWorld
private

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