Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Friends | List of all members
castor3d::Submesh Class Reference

#include <Submesh.hpp>

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

Public Member Functions

 Submesh (Submesh const &)=delete
 
 Submesh (Submesh &&) noexcept=default
 
Submeshoperator= (Submesh const &)=delete
 
Submeshoperator= (Submesh &&) noexcept=default
 
C3D_API Submesh (Mesh &mesh, uint32_t id=1)
 Constructor.
 
C3D_API ~Submesh () noexcept
 Destructor.
 
C3D_API void initialise (RenderDevice const &device)
 Initialises the submesh.
 
C3D_API void cleanup (RenderDevice const &device)
 Cleans the submesh.
 
C3D_API void upload (UploadData &uploader)
 Updates the buffers.
 
C3D_API void update (CpuUpdater &updater)
 Updates the render components.
 
C3D_API crg::FramePassArray record (crg::ResourcesCache &resources, crg::FramePassGroup &graph, crg::FramePassArray previousPasses)
 Records the components' dependent render passes.
 
C3D_API void registerDependencies (crg::FramePass &pass) const
 Records the components's dependencies.
 
C3D_API void accept (ConfigurationVisitorBase &vis)
 ConfigurationVisitorBase acceptance function.
 
C3D_API void computeContainers ()
 Computes the containers (cube and sphere)
 
C3D_API uint32_t getFaceCount () const
 
C3D_API uint32_t getPointsCount () const
 
C3D_API int isInMyPoints (castor::Point3f const &position, double precision)
 Tests if the given Point3f is in mine.
 
C3D_API InterleavedVertex addPoint (float x, float y, float z)
 Creates and Adds a vertex to my list.
 
C3D_API InterleavedVertex addPoint (castor::Point3f const &value)
 Adds a vertex to my list.
 
C3D_API InterleavedVertex addPoint (float const *value)
 Creates and Adds a vertex to my list.
 
C3D_API void addPoint (InterleavedVertex const &value)
 Adds a vertex to the list.
 
C3D_API void addPoints (InterleavedVertex const *const begin, InterleavedVertex const *const end)
 Adds a points list to my list.
 
C3D_API void computeNormals (bool reverted=false)
 Generates normals and tangents.
 
C3D_API ProgramFlags getProgramFlags (Pass const &pass) const noexcept
 
C3D_API MorphFlags getMorphFlags () const
 
C3D_API void instantiate (MaterialObs oldMaterial, MaterialObs newMaterial, bool update)
 Instantiates the submesh with a geometry and its material.
 
C3D_API void instantiate (Geometry const &geometry, MaterialObs oldMaterial, MaterialObs newMaterial, bool update)
 
C3D_API GeometryBuffers const & getGeometryBuffers (Geometry const &geometry, Pass const &pass, PipelineFlags const &flags) const
 
C3D_API void enableSceneUpdate (bool updateScene)
 Enables scene update on modifications.
 
C3D_API void setBaseData (SubmeshData submeshData, castor::Point3fArray data)
 
C3D_API void setBaseData (SubmeshData submeshData, castor::Point4fArray data)
 
C3D_API void addComponent (SubmeshComponentUPtr component)
 
void disableSceneUpdate ()
 
void needsUpdate ()
 
void addPoints (castor::Vector< InterleavedVertex > const &vertices)
 
template<size_t Count>
void addPoints (castor::Array< InterleavedVertex, Count > const &vertices)
 
void setDefaultMaterial (MaterialObs material)
 
void setIndexMapping (IndexMappingUPtr mapping)
 
IndexMappingRPtr getIndexMapping () const
 
template<typename ComponentT , typename ... ParamsT>
ComponentT * createComponent (ParamsT &&... params)
 
void setTopology (VkPrimitiveTopology value)
 
C3D_API InterleavedVertex getInterleavedPoint (uint32_t index) const
 
C3D_API castor::Point3fArray const & getPositions () const
 
C3D_API castor::Point3fArray & getPositions ()
 
C3D_API castor::Point3fArray const & getNormals () const
 
C3D_API castor::Point3fArray & getNormals ()
 
C3D_API castor::Point4fArray const & getTangents () const
 
C3D_API castor::Point4fArray & getTangents ()
 
C3D_API castor::Point3fArray const & getBitangents () const
 
C3D_API castor::Point3fArray & getBitangents ()
 
C3D_API castor::Point3fArray const & getTexcoords0 () const
 
C3D_API castor::Point3fArray & getTexcoords0 ()
 
C3D_API castor::Point3fArray const & getTexcoords1 () const
 
C3D_API castor::Point3fArray & getTexcoords1 ()
 
C3D_API castor::Point3fArray const & getTexcoords2 () const
 
C3D_API castor::Point3fArray & getTexcoords2 ()
 
C3D_API castor::Point3fArray const & getTexcoords3 () const
 
C3D_API castor::Point3fArray & getTexcoords3 ()
 
C3D_API castor::Point3fArray const & getColours () const
 
C3D_API castor::Point3fArray & getColours ()
 
C3D_API castor::Point3fArray const & getBaseData (SubmeshData submeshData) const
 
C3D_API castor::Point3fArray & getBaseData (SubmeshData submeshData)
 
C3D_API GpuBufferOffsetT< castor::Point4f > const & getMorphTargets () const
 
C3D_API uint32_t getMorphTargetsCount () const
 
C3D_API castor::Vector< Meshlet > const & getMeshlets () const
 
C3D_API castor::Vector< Meshlet > & getMeshlets ()
 
C3D_API uint32_t getMeshletsCount () const
 
C3D_API bool isDynamic () const
 
C3D_API bool isAnimated () const
 
C3D_API ObjectBufferOffset const & getFinalBufferOffsets (Geometry const &geometry, Pass const &pass) const
 
C3D_API ObjectBufferOffset const & getSourceBufferOffsets () const
 
C3D_API GpuBufferOffsetT< MeshletCullData > const & getFinalMeshletsBounds (Geometry const &geometry, Pass const &pass) const
 
C3D_API GpuBufferOffsetT< MeshletCullData > const & getSourceMeshletsBounds () const
 
C3D_API bool hasMorphComponent () const
 
C3D_API bool hasSkinComponent () const
 
C3D_API VkDeviceSize getVertexOffset (Geometry const &geometry, Pass const &pass) const
 
C3D_API VkDeviceSize getIndexOffset () const
 
C3D_API VkDeviceSize getMeshletOffset () const
 
C3D_API SubmeshComponentRegistergetSubmeshComponentsRegister () const
 
C3D_API SubmeshComponentID getComponentId (castor::String const &componentType) const
 
C3D_API SubmeshComponentPlugin const & getComponentPlugin (SubmeshComponentID componentId) const
 
C3D_API SubmeshComponentCombineID getComponentCombineID () const noexcept
 
C3D_API bool hasRenderComponent () const noexcept
 
C3D_API SubmeshRenderDatagetRenderData () const
 
SkeletonRPtr getSkeleton () const noexcept
 
MaterialObs getDefaultMaterial () const noexcept
 
castor::BoundingBox const & getBoundingBox () const noexcept
 
castor::BoundingBoxgetBoundingBox () noexcept
 
castor::BoundingSphere const & getBoundingSphere () const noexcept
 
castor::BoundingSpheregetBoundingSphere () noexcept
 
bool isInitialised () const noexcept
 
MeshgetParent () const noexcept
 
uint32_t getId () const noexcept
 
bool hasComponent (castor::String const &name) const noexcept
 
SubmeshComponentRPtr getComponent (castor::String const &name) const noexcept
 
InstantiationComponentgetInstantiation () noexcept
 
InstantiationComponent const & getInstantiation () const noexcept
 
SubmeshComponentIDMap const & getComponents () const noexcept
 
VkPrimitiveTopology getTopology () const noexcept
 
SubmeshComponentCombine getComponentCombine () const noexcept
 
SubmeshComponentPlugin const & getComponentPlugin (castor::String const &componentType) const
 
template<typename ComponentT >
ComponentT * getComponent () const noexcept
 
template<typename ComponentT >
SubmeshComponentPlugin const & getComponentPlugin () const
 
template<typename ComponentT >
bool hasComponent () const
 
- Public Member Functions inherited from castor::OwnedBy< Mesh >
Mesh * getOwner () const
 

Friends

class BinaryWriter< Submesh >
 
class BinaryParser< Submesh >
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Mesh >
 OwnedBy (Mesh &owner)
 Constructor.
 

Constructor & Destructor Documentation

◆ Submesh() [1/3]

castor3d::Submesh::Submesh ( Submesh const & )
delete

◆ Submesh() [2/3]

castor3d::Submesh::Submesh ( Submesh && )
defaultnoexcept

◆ Submesh() [3/3]

C3D_API castor3d::Submesh::Submesh ( Mesh & mesh,
uint32_t id = 1 )
explicit

Constructor.

Parameters
[in]meshThe parent mesh.
[in]idThe submesh ID.

◆ ~Submesh()

C3D_API castor3d::Submesh::~Submesh ( )
noexcept

Destructor.

Member Function Documentation

◆ accept()

C3D_API void castor3d::Submesh::accept ( ConfigurationVisitorBase & vis)

ConfigurationVisitorBase acceptance function.

Parameters
[in,out]visThe ... visitor.

◆ addComponent()

C3D_API void castor3d::Submesh::addComponent ( SubmeshComponentUPtr component)

◆ addPoint() [1/4]

C3D_API InterleavedVertex castor3d::Submesh::addPoint ( castor::Point3f const & value)

Adds a vertex to my list.

Parameters
[in]valueThe vertex to add
Returns
The vertex

◆ addPoint() [2/4]

C3D_API InterleavedVertex castor3d::Submesh::addPoint ( float const * value)

Creates and Adds a vertex to my list.

Parameters
[in]valueThe vertex coordinates
Returns
The created vertex

◆ addPoint() [3/4]

C3D_API InterleavedVertex castor3d::Submesh::addPoint ( float x,
float y,
float z )

Creates and Adds a vertex to my list.

Parameters
[in]xThe vertex X coordinate
[in]yThe vertex Y coordinate
[in]zThe vertex Z coordinate
Returns
The created vertex

◆ addPoint() [4/4]

C3D_API void castor3d::Submesh::addPoint ( InterleavedVertex const & value)

Adds a vertex to the list.

Parameters
[in]valueThe vertex.

◆ addPoints() [1/3]

template<size_t Count>
void castor3d::Submesh::addPoints ( castor::Array< InterleavedVertex, Count > const & vertices)

◆ addPoints() [2/3]

void castor3d::Submesh::addPoints ( castor::Vector< InterleavedVertex > const & vertices)

◆ addPoints() [3/3]

C3D_API void castor3d::Submesh::addPoints ( InterleavedVertex const *const begin,
InterleavedVertex const *const end )

Adds a points list to my list.

Parameters
[in]beginThe vertices data begin.
[in]endThe vertices data end.

◆ cleanup()

C3D_API void castor3d::Submesh::cleanup ( RenderDevice const & device)

Cleans the submesh.

Parameters
[in]deviceThe render device.

◆ computeContainers()

C3D_API void castor3d::Submesh::computeContainers ( )

Computes the containers (cube and sphere)

◆ computeNormals()

C3D_API void castor3d::Submesh::computeNormals ( bool reverted = false)

Generates normals and tangents.

Parameters
[in]revertedtrue to inverse normals.

◆ createComponent()

template<typename ComponentT , typename ... ParamsT>
ComponentT * castor3d::Submesh::createComponent ( ParamsT &&... params)

◆ disableSceneUpdate()

void castor3d::Submesh::disableSceneUpdate ( )

◆ enableSceneUpdate()

C3D_API void castor3d::Submesh::enableSceneUpdate ( bool updateScene)

Enables scene update on modifications.

name Mutators.

Parameters
[in]updateSceneTells if this call triggers a scene update.

◆ getBaseData() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getBaseData ( SubmeshData submeshData)

◆ getBaseData() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getBaseData ( SubmeshData submeshData) const

◆ getBitangents() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getBitangents ( )

◆ getBitangents() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getBitangents ( ) const

◆ getBoundingBox() [1/2]

castor::BoundingBox const & castor3d::Submesh::getBoundingBox ( ) const
noexcept

◆ getBoundingBox() [2/2]

castor::BoundingBox & castor3d::Submesh::getBoundingBox ( )
noexcept

◆ getBoundingSphere() [1/2]

castor::BoundingSphere const & castor3d::Submesh::getBoundingSphere ( ) const
noexcept

◆ getBoundingSphere() [2/2]

castor::BoundingSphere & castor3d::Submesh::getBoundingSphere ( )
noexcept

◆ getColours() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getColours ( )

◆ getColours() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getColours ( ) const

◆ getComponent() [1/2]

template<typename ComponentT >
ComponentT * castor3d::Submesh::getComponent ( ) const
noexcept

◆ getComponent() [2/2]

SubmeshComponentRPtr castor3d::Submesh::getComponent ( castor::String const & name) const
noexcept

◆ getComponentCombine()

SubmeshComponentCombine castor3d::Submesh::getComponentCombine ( ) const
noexcept

◆ getComponentCombineID()

C3D_API SubmeshComponentCombineID castor3d::Submesh::getComponentCombineID ( ) const
noexcept

◆ getComponentId()

C3D_API SubmeshComponentID castor3d::Submesh::getComponentId ( castor::String const & componentType) const

◆ getComponentPlugin() [1/3]

template<typename ComponentT >
SubmeshComponentPlugin const & castor3d::Submesh::getComponentPlugin ( ) const

◆ getComponentPlugin() [2/3]

SubmeshComponentPlugin const & castor3d::Submesh::getComponentPlugin ( castor::String const & componentType) const

◆ getComponentPlugin() [3/3]

C3D_API SubmeshComponentPlugin const & castor3d::Submesh::getComponentPlugin ( SubmeshComponentID componentId) const

◆ getComponents()

SubmeshComponentIDMap const & castor3d::Submesh::getComponents ( ) const
noexcept

◆ getDefaultMaterial()

MaterialObs castor3d::Submesh::getDefaultMaterial ( ) const
noexcept

◆ getFaceCount()

C3D_API uint32_t castor3d::Submesh::getFaceCount ( ) const
Returns
The faces number

◆ getFinalBufferOffsets()

C3D_API ObjectBufferOffset const & castor3d::Submesh::getFinalBufferOffsets ( Geometry const & geometry,
Pass const & pass ) const

◆ getFinalMeshletsBounds()

C3D_API GpuBufferOffsetT< MeshletCullData > const & castor3d::Submesh::getFinalMeshletsBounds ( Geometry const & geometry,
Pass const & pass ) const

◆ getGeometryBuffers()

C3D_API GeometryBuffers const & castor3d::Submesh::getGeometryBuffers ( Geometry const & geometry,
Pass const & pass,
PipelineFlags const & flags ) const
Returns
The geometry buffers for given render node.
Parameters
[in]geometryThe geometry instancing this submesh.
[in]passThe pass used to render this submesh.
[in]flagsThe pipeline flags.

◆ getId()

uint32_t castor3d::Submesh::getId ( ) const
noexcept

◆ getIndexMapping()

IndexMappingRPtr castor3d::Submesh::getIndexMapping ( ) const

◆ getIndexOffset()

C3D_API VkDeviceSize castor3d::Submesh::getIndexOffset ( ) const

◆ getInstantiation() [1/2]

InstantiationComponent const & castor3d::Submesh::getInstantiation ( ) const
noexcept

◆ getInstantiation() [2/2]

InstantiationComponent & castor3d::Submesh::getInstantiation ( )
noexcept

◆ getInterleavedPoint()

C3D_API InterleavedVertex castor3d::Submesh::getInterleavedPoint ( uint32_t index) const

name Getters.

◆ getMeshletOffset()

C3D_API VkDeviceSize castor3d::Submesh::getMeshletOffset ( ) const

◆ getMeshlets() [1/2]

C3D_API castor::Vector< Meshlet > & castor3d::Submesh::getMeshlets ( )

◆ getMeshlets() [2/2]

C3D_API castor::Vector< Meshlet > const & castor3d::Submesh::getMeshlets ( ) const

◆ getMeshletsCount()

C3D_API uint32_t castor3d::Submesh::getMeshletsCount ( ) const

◆ getMorphFlags()

C3D_API MorphFlags castor3d::Submesh::getMorphFlags ( ) const
Returns
The morphing flags.

◆ getMorphTargets()

C3D_API GpuBufferOffsetT< castor::Point4f > const & castor3d::Submesh::getMorphTargets ( ) const

◆ getMorphTargetsCount()

C3D_API uint32_t castor3d::Submesh::getMorphTargetsCount ( ) const

◆ getNormals() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getNormals ( )

◆ getNormals() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getNormals ( ) const

◆ getParent()

Mesh & castor3d::Submesh::getParent ( ) const
noexcept

◆ getPointsCount()

C3D_API uint32_t castor3d::Submesh::getPointsCount ( ) const
Returns
The points count

◆ getPositions() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getPositions ( )

◆ getPositions() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getPositions ( ) const

◆ getProgramFlags()

C3D_API ProgramFlags castor3d::Submesh::getProgramFlags ( Pass const & pass) const
noexcept
Returns
The program flags.
Parameters
[in]passThe material pass for which we want the flags.

◆ getRenderData()

C3D_API SubmeshRenderData * castor3d::Submesh::getRenderData ( ) const

◆ getSkeleton()

SkeletonRPtr castor3d::Submesh::getSkeleton ( ) const
noexcept

◆ getSourceBufferOffsets()

C3D_API ObjectBufferOffset const & castor3d::Submesh::getSourceBufferOffsets ( ) const

◆ getSourceMeshletsBounds()

C3D_API GpuBufferOffsetT< MeshletCullData > const & castor3d::Submesh::getSourceMeshletsBounds ( ) const

◆ getSubmeshComponentsRegister()

C3D_API SubmeshComponentRegister & castor3d::Submesh::getSubmeshComponentsRegister ( ) const

◆ getTangents() [1/2]

C3D_API castor::Point4fArray & castor3d::Submesh::getTangents ( )

◆ getTangents() [2/2]

C3D_API castor::Point4fArray const & castor3d::Submesh::getTangents ( ) const

◆ getTexcoords0() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords0 ( )

◆ getTexcoords0() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords0 ( ) const

◆ getTexcoords1() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords1 ( )

◆ getTexcoords1() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords1 ( ) const

◆ getTexcoords2() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords2 ( )

◆ getTexcoords2() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords2 ( ) const

◆ getTexcoords3() [1/2]

C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords3 ( )

◆ getTexcoords3() [2/2]

C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords3 ( ) const

◆ getTopology()

VkPrimitiveTopology castor3d::Submesh::getTopology ( ) const
noexcept

◆ getVertexOffset()

C3D_API VkDeviceSize castor3d::Submesh::getVertexOffset ( Geometry const & geometry,
Pass const & pass ) const

◆ hasComponent() [1/2]

template<typename ComponentT >
bool castor3d::Submesh::hasComponent ( ) const

◆ hasComponent() [2/2]

bool castor3d::Submesh::hasComponent ( castor::String const & name) const
noexcept

◆ hasMorphComponent()

C3D_API bool castor3d::Submesh::hasMorphComponent ( ) const

◆ hasRenderComponent()

C3D_API bool castor3d::Submesh::hasRenderComponent ( ) const
noexcept

◆ hasSkinComponent()

C3D_API bool castor3d::Submesh::hasSkinComponent ( ) const

◆ initialise()

C3D_API void castor3d::Submesh::initialise ( RenderDevice const & device)

Initialises the submesh.

Parameters
[in]deviceThe render device.

◆ instantiate() [1/2]

C3D_API void castor3d::Submesh::instantiate ( Geometry const & geometry,
MaterialObs oldMaterial,
MaterialObs newMaterial,
bool update )
inline

References update().

Here is the call graph for this function:

◆ instantiate() [2/2]

C3D_API void castor3d::Submesh::instantiate ( MaterialObs oldMaterial,
MaterialObs newMaterial,
bool update )
inline

Instantiates the submesh with a geometry and its material.

Parameters
[in]oldMaterialThe old material.
[in]newMaterialThe new material.
[in]updateTells if the instantiation component must be updated.

References update().

Here is the call graph for this function:

◆ isAnimated()

C3D_API bool castor3d::Submesh::isAnimated ( ) const

◆ isDynamic()

C3D_API bool castor3d::Submesh::isDynamic ( ) const

◆ isInitialised()

bool castor3d::Submesh::isInitialised ( ) const
noexcept

◆ isInMyPoints()

C3D_API int castor3d::Submesh::isInMyPoints ( castor::Point3f const & position,
double precision )

Tests if the given Point3f is in mine.

Parameters
[in]positionThe vertex to test
[in]precisionThe comparison precision
Returns
The index of the vertex equal to parameter, -1 if not found

◆ needsUpdate()

void castor3d::Submesh::needsUpdate ( )

◆ operator=() [1/2]

Submesh & castor3d::Submesh::operator= ( Submesh && )
defaultnoexcept

◆ operator=() [2/2]

Submesh & castor3d::Submesh::operator= ( Submesh const & )
delete

◆ record()

C3D_API crg::FramePassArray castor3d::Submesh::record ( crg::ResourcesCache & resources,
crg::FramePassGroup & graph,
crg::FramePassArray previousPasses )

Records the components' dependent render passes.

◆ registerDependencies()

C3D_API void castor3d::Submesh::registerDependencies ( crg::FramePass & pass) const

Records the components's dependencies.

◆ setBaseData() [1/2]

C3D_API void castor3d::Submesh::setBaseData ( SubmeshData submeshData,
castor::Point3fArray data )

◆ setBaseData() [2/2]

C3D_API void castor3d::Submesh::setBaseData ( SubmeshData submeshData,
castor::Point4fArray data )

◆ setDefaultMaterial()

void castor3d::Submesh::setDefaultMaterial ( MaterialObs material)

◆ setIndexMapping()

void castor3d::Submesh::setIndexMapping ( IndexMappingUPtr mapping)

◆ setTopology()

void castor3d::Submesh::setTopology ( VkPrimitiveTopology value)

◆ update()

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

Updates the render components.

Referenced by instantiate(), and instantiate().

Here is the caller graph for this function:

◆ upload()

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

Updates the buffers.

Friends And Related Symbol Documentation

◆ BinaryParser< Submesh >

friend class BinaryParser< Submesh >
friend

◆ BinaryWriter< Submesh >

friend class BinaryWriter< Submesh >
friend

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