Castor3D 0.16.0
Multiplatform 3D engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
castor3d::InstantiationComponent Class Reference

#include <InstantiationComponent.hpp>

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

Classes

struct  ComponentData
 
struct  Data
 
class  Plugin
 

Public Types

using InstanceDataMap = castor::Map< uint32_t, Data >
 

Public Member Functions

C3D_API InstantiationComponent (Submesh &submesh, uint32_t threshold=1u)
 Constructor.
 
C3D_API SubmeshComponentUPtr clone (Submesh &submesh) const override
 Clones this component into given submesh.
 
C3D_API ProgramFlags getProgramFlags (Pass const &pass) const noexcept override
 
C3D_API bool isInstanced (Pass const &pass) const
 
C3D_API bool isInstanced () const
 
ComponentDatagetData () const noexcept
 
- Public Member Functions inherited from castor3d::SubmeshComponent
C3D_API SubmeshComponent (Submesh &submesh, castor::String const &type, SubmeshComponentDataUPtr data={}, castor::StringArray deps={})
 Constructor.
 
virtual C3D_API ~SubmeshComponent () noexcept=default
 Destructor.
 
virtual C3D_API bool writeText (castor::String const &tabs, castor::Path const &folder, castor::String const &subfolder, castor::StringStream &file) const
 Writes the component content to text.
 
virtual C3D_API void accept (ConfigurationVisitorBase &vis)
 ConfigurationVisitorBase acceptance function.
 
virtual C3D_API SubmeshComponentFlag getSubmeshFlags () const noexcept
 
C3D_API void initialiseRenderData ()
 Initialises the render data specific for this component's submesh.
 
castor::String const & getType () const noexcept
 
castor::StringArray const & getDependencies () const noexcept
 
SubmeshComponentPlugin const & getPlugin () const noexcept
 
SubmeshComponentID getId () const noexcept
 
SubmeshComponentDataRPtr getBaseData () const noexcept
 
SubmeshRenderDatagetRenderData () const noexcept
 
template<typename DataT >
DataT * getDataT () const noexcept
 
template<typename DataT >
DataT * getRenderDataT () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Submesh >
Submesh * getOwner () const
 

Static Public Member Functions

static SubmeshComponentPluginUPtr createPlugin (SubmeshComponentRegister const &submeshComponents)
 

Static Public Attributes

static C3D_API castor::String const TypeName
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Submesh >
 OwnedBy (Submesh &owner)
 Constructor.
 
- Protected Attributes inherited from castor3d::SubmeshComponent
SubmeshComponentDataUPtr m_data
 
SubmeshRenderDataPtr m_renderData
 

Member Typedef Documentation

◆ InstanceDataMap

Constructor & Destructor Documentation

◆ InstantiationComponent()

C3D_API castor3d::InstantiationComponent::InstantiationComponent ( Submesh & submesh,
uint32_t threshold = 1u )
explicit

Constructor.

Parameters
[in]submeshThe parent submesh.
[in]thresholdThe threshold from which a submesh will be instantiated.

Member Function Documentation

◆ clone()

C3D_API SubmeshComponentUPtr castor3d::InstantiationComponent::clone ( Submesh & submesh) const
overridevirtual

Clones this component into given submesh.

Parameters
[in,out]submeshReceives the cloned component.

Implements castor3d::SubmeshComponent.

◆ createPlugin()

static SubmeshComponentPluginUPtr castor3d::InstantiationComponent::createPlugin ( SubmeshComponentRegister const & submeshComponents)
inlinestatic

◆ getData()

ComponentData & castor3d::InstantiationComponent::getData ( ) const
inlinenoexcept

◆ getProgramFlags()

C3D_API ProgramFlags castor3d::InstantiationComponent::getProgramFlags ( Pass const & pass) const
overridevirtualnoexcept

Returns
The program flags.
Parameters
[in]passThe material pass.

Reimplemented from castor3d::SubmeshComponent.

◆ isInstanced() [1/2]

C3D_API bool castor3d::InstantiationComponent::isInstanced ( ) const
Returns
true if the max instance count is greater than the threshold.

◆ isInstanced() [2/2]

C3D_API bool castor3d::InstantiationComponent::isInstanced ( Pass const & pass) const
Parameters
[in]passThe material pass.
Returns
true if the instance count for given material is greater than the threshold.

Member Data Documentation

◆ TypeName

C3D_API castor::String const castor3d::InstantiationComponent::TypeName
static

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