Castor3D 0.17.0
Multiplatform 3D engine
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
castor3d::Scene Class Reference

#include <Scene.hpp>

Inheritance diagram for castor3d::Scene:
Inheritance graph
[legend]
Collaboration diagram for castor3d::Scene:
Collaboration graph
[legend]

Public Member Functions

C3D_API Scene (castor::String const &name, Engine &engine)
 Constructor.
 
C3D_API ~Scene () noexcept
 Destructor.
 
C3D_API void initialise ()
 Initialises the scene.
 
C3D_API void updateBoundingBox ()
 Computes the scene AABB.
 
C3D_API void cleanup ()
 Clears the maps, leaves the root nodes.
 
C3D_API void update (CpuUpdater &updater)
 Updates the scene before render.
 
C3D_API void upload (UploadData &uploader)
 Uploads the scene objects data.
 
C3D_API void update (GpuUpdater &updater)
 Updates the scene device dependant stuff.
 
C3D_API void setBackground (SceneBackgroundUPtr value)
 Sets the background for the scene.
 
C3D_API void merge (Scene &scene)
 Merges the content of the given scene to this scene.
 
C3D_API uint32_t getVertexCount () const
 Retrieves the vertices count.
 
C3D_API uint32_t getFaceCount () const
 Retrieves the faces count.
 
C3D_API SceneFlags getFlags () const
 
C3D_API bool hasShadows () const
 
C3D_API bool hasShadows (LightType lightType) const
 
C3D_API void addEnvironmentMap (SceneNode &node)
 Creates a reflection map for given node.
 
C3D_API void removeEnvironmentMap (SceneNode &node)
 Creates a reflection map for given node.
 
C3D_API bool hasEnvironmentMap (SceneNode &node) const
 
C3D_API EnvironmentMap & getEnvironmentMap () const
 
C3D_API uint32_t getEnvironmentMapIndex (SceneNode const &node) const
 
C3D_API castor::String const & getBackgroundModel () const
 
C3D_API castor::Vector< LightingModelID > getLightingModelsID () const
 
C3D_API AnimatedObjectRPtr addAnimatedTexture (TextureSourceInfo const &sourceInfo, TextureConfiguration const &config, Pass &pass)
 Creates an animated texture and adds it to animated textures group.
 
C3D_API void markDirty (SceneNode &object)
 Adds given node to dirty nodes list.
 
C3D_API void markDirty (BillboardBase &object)
 Adds given BillboardBase to dirty BillboardBase list.
 
C3D_API void markDirty (MovableObject &object)
 Adds given object to dirty object list.
 

Getters.

C3D_API BackgroundModelID getBackgroundModelId () const
 
C3D_API LightingModelID getDefaultLightingModel () const
 
C3D_API castor::String getDefaultLightingModelName () const
 
C3D_API bool needsGlobalIllumination () const
 
C3D_API bool needsGlobalIllumination (GlobalIlluminationType giType) const
 
C3D_API bool needsGlobalIllumination (LightType ltType, GlobalIlluminationType giType) const
 
C3D_API crg::SemaphoreWaitArray getRenderTargetsSemaphores () const
 
C3D_API uint32_t getLpvGridSize () const
 
C3D_API bool hasBindless () const
 
C3D_API ashes::DescriptorSetLayout * getBindlessTexDescriptorLayout () const
 
C3D_API ashes::DescriptorPool * getBindlessTexDescriptorPool () const
 
C3D_API ashes::DescriptorSet * getBindlessTexDescriptorSet () const
 
C3D_API ashes::Buffer< ModelBufferConfiguration > const & getModelBuffer () const
 
C3D_API ashes::Buffer< BillboardUboConfiguration > const & getBillboardsBuffer () const
 
C3D_API bool hasObjects (LightingModelID lightingModelId) const
 
castor::BoundingBox const & getBoundingBox () const noexcept
 
SceneBackgroundRPtr getBackground () const noexcept
 
castor::RgbColour const & getBackgroundColour () const noexcept
 
SceneNodeRPtr getRootNode () const noexcept
 
SceneNodeRPtr getCameraRootNode () const noexcept
 
SceneNodeRPtr getObjectRootNode () const noexcept
 
castor::RgbColour const & getAmbientLight () const noexcept
 
Fog const & getFog () const noexcept
 
Fog & getFog () noexcept
 
FrameListener & getListener () const noexcept
 
bool isInitialised () const noexcept
 
bool needsSubsurfaceScattering () const noexcept
 
bool hasOpaqueObjects () const noexcept
 
bool hasTransparentObjects () const noexcept
 
uint32_t getDirectionalShadowCascades () const noexcept
 
float getLpvIndirectAttenuation () const noexcept
 
VctConfig const & getVoxelConeTracingConfig () const noexcept
 
VctConfig & getVoxelConeTracingConfig () noexcept
 
SceneRenderNodes & getRenderNodes () const noexcept
 
LightFactory & getLightsFactory () const noexcept
 
crg::ResourcesCache & getResources () noexcept
 
DebugConfig & getDebugConfig () const noexcept
 
SceneUbo const & getUbo () const noexcept
 
C3D_API void setDirectionalShadowCascades (uint32_t value)
 
C3D_API void setLpvIndirectAttenuation (float value)
 
C3D_API void setDefaultLightingModel (LightingModelID value)
 
void setBackgroundColour (castor::RgbColour const &value) noexcept
 
void setAmbientLight (castor::RgbColour const &value) noexcept
 
GeometryCache::ElementObsT addGeometry (GeometryCache::ElementPtrT element)
 
- Public Member Functions inherited from castor::OwnedBy< Engine >
Engine * getOwner () const noexcept
 
void setOwner (Engine &owner) noexcept
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 

Static Public Member Functions

static C3D_API void addParsers (castor::AttributeParsers &result)
 

Public Attributes

OnSceneUpdate onUpdate
 
OnBackgroundChanged onSetBackground
 

Static Public Attributes

static C3D_API castor::String CameraRootNode
 
static C3D_API castor::String ObjectRootNode
 
static C3D_API castor::String RootNode
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Engine >
 OwnedBy (Engine &owner) noexcept
 Constructor.
 
- Protected Attributes inherited from castor::NamedBaseT< T >
T m_name
 

Constructor & Destructor Documentation

◆ Scene()

C3D_API castor3d::Scene::Scene ( castor::String const & name,
Engine & engine )

Constructor.

Parameters
[in]nameThe scene name
[in]engineThe core engine

◆ ~Scene()

C3D_API castor3d::Scene::~Scene ( )
noexcept

Destructor.

Member Function Documentation

◆ addAnimatedTexture()

C3D_API AnimatedObjectRPtr castor3d::Scene::addAnimatedTexture ( TextureSourceInfo const & sourceInfo,
TextureConfiguration const & config,
Pass & pass )

Creates an animated texture and adds it to animated textures group.

Parameters
[in]sourceInfoThe texture source info.
[in]configThe texture configuration.
[in]passThe target material pass.
Returns
The animated texture.

◆ addEnvironmentMap()

C3D_API void castor3d::Scene::addEnvironmentMap ( SceneNode & node)

Creates a reflection map for given node.

Parameters
[in]nodeThe scene node from which the reflection map is generated.

◆ addGeometry()

GeometryCache::ElementObsT castor3d::Scene::addGeometry ( GeometryCache::ElementPtrT element)
inline

◆ addParsers()

static C3D_API void castor3d::Scene::addParsers ( castor::AttributeParsers & result)
static

◆ cleanup()

C3D_API void castor3d::Scene::cleanup ( )

Clears the maps, leaves the root nodes.

◆ getAmbientLight()

castor::RgbColour const & castor3d::Scene::getAmbientLight ( ) const
inlinenoexcept

◆ getBackground()

SceneBackgroundRPtr castor3d::Scene::getBackground ( ) const
inlinenoexcept

◆ getBackgroundColour()

castor::RgbColour const & castor3d::Scene::getBackgroundColour ( ) const
inlinenoexcept

◆ getBackgroundModel()

C3D_API castor::String const & castor3d::Scene::getBackgroundModel ( ) const
Returns
The background model name.

◆ getBackgroundModelId()

C3D_API BackgroundModelID castor3d::Scene::getBackgroundModelId ( ) const

◆ getBillboardsBuffer()

C3D_API ashes::Buffer< BillboardUboConfiguration > const & castor3d::Scene::getBillboardsBuffer ( ) const

◆ getBindlessTexDescriptorLayout()

C3D_API ashes::DescriptorSetLayout * castor3d::Scene::getBindlessTexDescriptorLayout ( ) const

◆ getBindlessTexDescriptorPool()

C3D_API ashes::DescriptorPool * castor3d::Scene::getBindlessTexDescriptorPool ( ) const

◆ getBindlessTexDescriptorSet()

C3D_API ashes::DescriptorSet * castor3d::Scene::getBindlessTexDescriptorSet ( ) const

◆ getBoundingBox()

castor::BoundingBox const & castor3d::Scene::getBoundingBox ( ) const
inlinenoexcept

◆ getCameraRootNode()

SceneNodeRPtr castor3d::Scene::getCameraRootNode ( ) const
inlinenoexcept

◆ getDebugConfig()

DebugConfig & castor3d::Scene::getDebugConfig ( ) const
inlinenoexcept

◆ getDefaultLightingModel()

C3D_API LightingModelID castor3d::Scene::getDefaultLightingModel ( ) const

◆ getDefaultLightingModelName()

C3D_API castor::String castor3d::Scene::getDefaultLightingModelName ( ) const

◆ getDirectionalShadowCascades()

uint32_t castor3d::Scene::getDirectionalShadowCascades ( ) const
inlinenoexcept

◆ getEnvironmentMap()

C3D_API EnvironmentMap & castor3d::Scene::getEnvironmentMap ( ) const
Returns
Retrieves the reflection map.
Remarks
Call hasEnvironmentMap before calling this function (since this one returns a reference to an existing EnvironmentMap).

◆ getEnvironmentMapIndex()

C3D_API uint32_t castor3d::Scene::getEnvironmentMapIndex ( SceneNode const & node) const
Returns
Retrieves the reflection map index for given node.
Remarks
Call hasEnvironmentMap before calling this function (since this one returns a reference to an existing EnvironmentMap).
Parameters
[in]nodeThe scene node.

◆ getFaceCount()

C3D_API uint32_t castor3d::Scene::getFaceCount ( ) const

Retrieves the faces count.

Returns
The value

◆ getFlags()

C3D_API SceneFlags castor3d::Scene::getFlags ( ) const
Returns
The scene flags.

◆ getFog() [1/2]

Fog const & castor3d::Scene::getFog ( ) const
inlinenoexcept

◆ getFog() [2/2]

Fog & castor3d::Scene::getFog ( )
inlinenoexcept

◆ getLightingModelsID()

C3D_API castor::Vector< LightingModelID > castor3d::Scene::getLightingModelsID ( ) const
Returns
The lighting models names for the current background model.

◆ getLightsFactory()

LightFactory & castor3d::Scene::getLightsFactory ( ) const
inlinenoexcept

◆ getListener()

FrameListener & castor3d::Scene::getListener ( ) const
inlinenoexcept

References CU_Require.

◆ getLpvGridSize()

C3D_API uint32_t castor3d::Scene::getLpvGridSize ( ) const

◆ getLpvIndirectAttenuation()

float castor3d::Scene::getLpvIndirectAttenuation ( ) const
inlinenoexcept

◆ getModelBuffer()

C3D_API ashes::Buffer< ModelBufferConfiguration > const & castor3d::Scene::getModelBuffer ( ) const

◆ getObjectRootNode()

SceneNodeRPtr castor3d::Scene::getObjectRootNode ( ) const
inlinenoexcept

◆ getRenderNodes()

SceneRenderNodes & castor3d::Scene::getRenderNodes ( ) const
inlinenoexcept

◆ getRenderTargetsSemaphores()

C3D_API crg::SemaphoreWaitArray castor3d::Scene::getRenderTargetsSemaphores ( ) const

◆ getResources()

crg::ResourcesCache & castor3d::Scene::getResources ( )
inlinenoexcept

◆ getRootNode()

SceneNodeRPtr castor3d::Scene::getRootNode ( ) const
inlinenoexcept

◆ getUbo()

SceneUbo const & castor3d::Scene::getUbo ( ) const
inlinenoexcept

◆ getVertexCount()

C3D_API uint32_t castor3d::Scene::getVertexCount ( ) const

Retrieves the vertices count.

Returns
The value

◆ getVoxelConeTracingConfig() [1/2]

VctConfig const & castor3d::Scene::getVoxelConeTracingConfig ( ) const
inlinenoexcept

◆ getVoxelConeTracingConfig() [2/2]

VctConfig & castor3d::Scene::getVoxelConeTracingConfig ( )
inlinenoexcept

◆ hasBindless()

C3D_API bool castor3d::Scene::hasBindless ( ) const

◆ hasEnvironmentMap()

C3D_API bool castor3d::Scene::hasEnvironmentMap ( SceneNode & node) const
Returns
Tells if there is a reflection map for given node.
Parameters
[in]nodeThe scene node.

◆ hasObjects()

C3D_API bool castor3d::Scene::hasObjects ( LightingModelID lightingModelId) const

◆ hasOpaqueObjects()

bool castor3d::Scene::hasOpaqueObjects ( ) const
inlinenoexcept

◆ hasShadows() [1/2]

C3D_API bool castor3d::Scene::hasShadows ( ) const
Returns
Tells if the scene has a shadow projecting light.

◆ hasShadows() [2/2]

C3D_API bool castor3d::Scene::hasShadows ( LightType lightType) const
Returns
Tells if the scene has a shadow projecting light of given type.

◆ hasTransparentObjects()

bool castor3d::Scene::hasTransparentObjects ( ) const
inlinenoexcept

◆ initialise()

C3D_API void castor3d::Scene::initialise ( )

Initialises the scene.

◆ isInitialised()

bool castor3d::Scene::isInitialised ( ) const
inlinenoexcept

◆ markDirty() [1/3]

C3D_API void castor3d::Scene::markDirty ( BillboardBase & object)

Adds given BillboardBase to dirty BillboardBase list.

Parameters
[in]objectThe scene node.

◆ markDirty() [2/3]

C3D_API void castor3d::Scene::markDirty ( MovableObject & object)

Adds given object to dirty object list.

Parameters
[in]objectThe object.

◆ markDirty() [3/3]

C3D_API void castor3d::Scene::markDirty ( SceneNode & object)

Adds given node to dirty nodes list.

Parameters
[in]objectThe scene node.

◆ merge()

C3D_API void castor3d::Scene::merge ( Scene & scene)

Merges the content of the given scene to this scene.

Parameters
[in]sceneThe scene to merge into this one

◆ needsGlobalIllumination() [1/3]

C3D_API bool castor3d::Scene::needsGlobalIllumination ( ) const

◆ needsGlobalIllumination() [2/3]

C3D_API bool castor3d::Scene::needsGlobalIllumination ( GlobalIlluminationType giType) const

◆ needsGlobalIllumination() [3/3]

C3D_API bool castor3d::Scene::needsGlobalIllumination ( LightType ltType,
GlobalIlluminationType giType ) const

◆ needsSubsurfaceScattering()

bool castor3d::Scene::needsSubsurfaceScattering ( ) const
inlinenoexcept

◆ removeEnvironmentMap()

C3D_API void castor3d::Scene::removeEnvironmentMap ( SceneNode & node)

Creates a reflection map for given node.

Parameters
[in]nodeThe scene node from which the reflection map is generated.

◆ setAmbientLight()

void castor3d::Scene::setAmbientLight ( castor::RgbColour const & value)
inlinenoexcept

◆ setBackground()

C3D_API void castor3d::Scene::setBackground ( SceneBackgroundUPtr value)

Sets the background for the scene.

Parameters
[in]valueThe new value.

◆ setBackgroundColour()

void castor3d::Scene::setBackgroundColour ( castor::RgbColour const & value)
inlinenoexcept

◆ setDefaultLightingModel()

C3D_API void castor3d::Scene::setDefaultLightingModel ( LightingModelID value)

◆ setDirectionalShadowCascades()

C3D_API void castor3d::Scene::setDirectionalShadowCascades ( uint32_t value)

name Mutators.

◆ setLpvIndirectAttenuation()

C3D_API void castor3d::Scene::setLpvIndirectAttenuation ( float value)

◆ update() [1/2]

C3D_API void castor3d::Scene::update ( CpuUpdater & updater)

Updates the scene before render.

◆ update() [2/2]

C3D_API void castor3d::Scene::update ( GpuUpdater & updater)

Updates the scene device dependant stuff.

◆ updateBoundingBox()

C3D_API void castor3d::Scene::updateBoundingBox ( )

Computes the scene AABB.

◆ upload()

C3D_API void castor3d::Scene::upload ( UploadData & uploader)

Uploads the scene objects data.

Member Data Documentation

◆ CameraRootNode

C3D_API castor::String castor3d::Scene::CameraRootNode
static

The cameras root node name.

◆ ObjectRootNode

C3D_API castor::String castor3d::Scene::ObjectRootNode
static

The objects root node name.

◆ onSetBackground

OnBackgroundChanged castor3d::Scene::onSetBackground
mutable

The signal raised when the scene background has changed.

◆ onUpdate

OnSceneUpdate castor3d::Scene::onUpdate
mutable

The signal raised when the scene is updating.

◆ RootNode

C3D_API castor::String castor3d::Scene::RootNode
static

The root node name.


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