Castor3D 0.16.0
Multiplatform 3D engine
|
#include <Submesh.hpp>
Public Member Functions | |
Submesh (Submesh const &)=delete | |
Submesh (Submesh &&) noexcept=default | |
Submesh & | operator= (Submesh const &)=delete |
Submesh & | operator= (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 SubmeshComponentRegister & | getSubmeshComponentsRegister () 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 SubmeshRenderData * | getRenderData () const |
SkeletonRPtr | getSkeleton () const noexcept |
MaterialObs | getDefaultMaterial () const noexcept |
castor::BoundingBox const & | getBoundingBox () const noexcept |
castor::BoundingBox & | getBoundingBox () noexcept |
castor::BoundingSphere const & | getBoundingSphere () const noexcept |
castor::BoundingSphere & | getBoundingSphere () noexcept |
bool | isInitialised () const noexcept |
Mesh & | getParent () const noexcept |
uint32_t | getId () const noexcept |
bool | hasComponent (castor::String const &name) const noexcept |
SubmeshComponentRPtr | getComponent (castor::String const &name) const noexcept |
InstantiationComponent & | getInstantiation () 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. | |
|
delete |
|
defaultnoexcept |
Constructor.
[in] | mesh | The parent mesh. |
[in] | id | The submesh ID. |
|
noexcept |
Destructor.
C3D_API void castor3d::Submesh::accept | ( | ConfigurationVisitorBase & | vis | ) |
ConfigurationVisitorBase acceptance function.
[in,out] | vis | The ... visitor. |
C3D_API void castor3d::Submesh::addComponent | ( | SubmeshComponentUPtr | component | ) |
C3D_API InterleavedVertex castor3d::Submesh::addPoint | ( | castor::Point3f const & | value | ) |
Adds a vertex to my list.
[in] | value | The vertex to add |
C3D_API InterleavedVertex castor3d::Submesh::addPoint | ( | float const * | value | ) |
Creates and Adds a vertex to my list.
[in] | value | The vertex coordinates |
C3D_API InterleavedVertex castor3d::Submesh::addPoint | ( | float | x, |
float | y, | ||
float | z ) |
Creates and Adds a vertex to my list.
[in] | x | The vertex X coordinate |
[in] | y | The vertex Y coordinate |
[in] | z | The vertex Z coordinate |
C3D_API void castor3d::Submesh::addPoint | ( | InterleavedVertex const & | value | ) |
Adds a vertex to the list.
[in] | value | The vertex. |
void castor3d::Submesh::addPoints | ( | castor::Array< InterleavedVertex, Count > const & | vertices | ) |
void castor3d::Submesh::addPoints | ( | castor::Vector< InterleavedVertex > const & | vertices | ) |
C3D_API void castor3d::Submesh::addPoints | ( | InterleavedVertex const *const | begin, |
InterleavedVertex const *const | end ) |
Adds a points list to my list.
[in] | begin | The vertices data begin. |
[in] | end | The vertices data end. |
C3D_API void castor3d::Submesh::cleanup | ( | RenderDevice const & | device | ) |
Cleans the submesh.
[in] | device | The render device. |
C3D_API void castor3d::Submesh::computeContainers | ( | ) |
Computes the containers (cube and sphere)
C3D_API void castor3d::Submesh::computeNormals | ( | bool | reverted = false | ) |
Generates normals and tangents.
[in] | reverted | true to inverse normals. |
ComponentT * castor3d::Submesh::createComponent | ( | ParamsT &&... | params | ) |
void castor3d::Submesh::disableSceneUpdate | ( | ) |
C3D_API void castor3d::Submesh::enableSceneUpdate | ( | bool | updateScene | ) |
Enables scene update on modifications.
name Mutators.
[in] | updateScene | Tells if this call triggers a scene update. |
C3D_API castor::Point3fArray & castor3d::Submesh::getBaseData | ( | SubmeshData | submeshData | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getBaseData | ( | SubmeshData | submeshData | ) | const |
C3D_API castor::Point3fArray & castor3d::Submesh::getBitangents | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getBitangents | ( | ) | const |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
C3D_API castor::Point3fArray & castor3d::Submesh::getColours | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getColours | ( | ) | const |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
C3D_API SubmeshComponentID castor3d::Submesh::getComponentId | ( | castor::String const & | componentType | ) | const |
SubmeshComponentPlugin const & castor3d::Submesh::getComponentPlugin | ( | ) | const |
SubmeshComponentPlugin const & castor3d::Submesh::getComponentPlugin | ( | castor::String const & | componentType | ) | const |
C3D_API SubmeshComponentPlugin const & castor3d::Submesh::getComponentPlugin | ( | SubmeshComponentID | componentId | ) | const |
|
noexcept |
|
noexcept |
C3D_API uint32_t castor3d::Submesh::getFaceCount | ( | ) | const |
C3D_API ObjectBufferOffset const & castor3d::Submesh::getFinalBufferOffsets | ( | Geometry const & | geometry, |
Pass const & | pass ) const |
C3D_API GpuBufferOffsetT< MeshletCullData > const & castor3d::Submesh::getFinalMeshletsBounds | ( | Geometry const & | geometry, |
Pass const & | pass ) const |
C3D_API GeometryBuffers const & castor3d::Submesh::getGeometryBuffers | ( | Geometry const & | geometry, |
Pass const & | pass, | ||
PipelineFlags const & | flags ) const |
[in] | geometry | The geometry instancing this submesh. |
[in] | pass | The pass used to render this submesh. |
[in] | flags | The pipeline flags. |
|
noexcept |
IndexMappingRPtr castor3d::Submesh::getIndexMapping | ( | ) | const |
C3D_API VkDeviceSize castor3d::Submesh::getIndexOffset | ( | ) | const |
|
noexcept |
|
noexcept |
C3D_API InterleavedVertex castor3d::Submesh::getInterleavedPoint | ( | uint32_t | index | ) | const |
name Getters.
C3D_API VkDeviceSize castor3d::Submesh::getMeshletOffset | ( | ) | const |
C3D_API castor::Vector< Meshlet > & castor3d::Submesh::getMeshlets | ( | ) |
C3D_API castor::Vector< Meshlet > const & castor3d::Submesh::getMeshlets | ( | ) | const |
C3D_API uint32_t castor3d::Submesh::getMeshletsCount | ( | ) | const |
C3D_API MorphFlags castor3d::Submesh::getMorphFlags | ( | ) | const |
C3D_API GpuBufferOffsetT< castor::Point4f > const & castor3d::Submesh::getMorphTargets | ( | ) | const |
C3D_API uint32_t castor3d::Submesh::getMorphTargetsCount | ( | ) | const |
C3D_API castor::Point3fArray & castor3d::Submesh::getNormals | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getNormals | ( | ) | const |
|
noexcept |
C3D_API uint32_t castor3d::Submesh::getPointsCount | ( | ) | const |
C3D_API castor::Point3fArray & castor3d::Submesh::getPositions | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getPositions | ( | ) | const |
|
noexcept |
[in] | pass | The material pass for which we want the flags. |
C3D_API SubmeshRenderData * castor3d::Submesh::getRenderData | ( | ) | const |
|
noexcept |
C3D_API ObjectBufferOffset const & castor3d::Submesh::getSourceBufferOffsets | ( | ) | const |
C3D_API GpuBufferOffsetT< MeshletCullData > const & castor3d::Submesh::getSourceMeshletsBounds | ( | ) | const |
C3D_API SubmeshComponentRegister & castor3d::Submesh::getSubmeshComponentsRegister | ( | ) | const |
C3D_API castor::Point4fArray & castor3d::Submesh::getTangents | ( | ) |
C3D_API castor::Point4fArray const & castor3d::Submesh::getTangents | ( | ) | const |
C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords0 | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords0 | ( | ) | const |
C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords1 | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords1 | ( | ) | const |
C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords2 | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords2 | ( | ) | const |
C3D_API castor::Point3fArray & castor3d::Submesh::getTexcoords3 | ( | ) |
C3D_API castor::Point3fArray const & castor3d::Submesh::getTexcoords3 | ( | ) | const |
|
noexcept |
C3D_API VkDeviceSize castor3d::Submesh::getVertexOffset | ( | Geometry const & | geometry, |
Pass const & | pass ) const |
bool castor3d::Submesh::hasComponent | ( | ) | const |
|
noexcept |
C3D_API bool castor3d::Submesh::hasMorphComponent | ( | ) | const |
|
noexcept |
C3D_API bool castor3d::Submesh::hasSkinComponent | ( | ) | const |
C3D_API void castor3d::Submesh::initialise | ( | RenderDevice const & | device | ) |
Initialises the submesh.
[in] | device | The render device. |
|
inline |
|
inline |
Instantiates the submesh with a geometry and its material.
[in] | oldMaterial | The old material. |
[in] | newMaterial | The new material. |
[in] | update | Tells if the instantiation component must be updated. |
References update().
C3D_API bool castor3d::Submesh::isAnimated | ( | ) | const |
C3D_API bool castor3d::Submesh::isDynamic | ( | ) | const |
|
noexcept |
C3D_API int castor3d::Submesh::isInMyPoints | ( | castor::Point3f const & | position, |
double | precision ) |
Tests if the given Point3f is in mine.
[in] | position | The vertex to test |
[in] | precision | The comparison precision |
void castor3d::Submesh::needsUpdate | ( | ) |
C3D_API crg::FramePassArray castor3d::Submesh::record | ( | crg::ResourcesCache & | resources, |
crg::FramePassGroup & | graph, | ||
crg::FramePassArray | previousPasses ) |
Records the components' dependent render passes.
C3D_API void castor3d::Submesh::registerDependencies | ( | crg::FramePass & | pass | ) | const |
Records the components's dependencies.
C3D_API void castor3d::Submesh::setBaseData | ( | SubmeshData | submeshData, |
castor::Point3fArray | data ) |
C3D_API void castor3d::Submesh::setBaseData | ( | SubmeshData | submeshData, |
castor::Point4fArray | data ) |
void castor3d::Submesh::setDefaultMaterial | ( | MaterialObs | material | ) |
void castor3d::Submesh::setIndexMapping | ( | IndexMappingUPtr | mapping | ) |
void castor3d::Submesh::setTopology | ( | VkPrimitiveTopology | value | ) |
C3D_API void castor3d::Submesh::update | ( | CpuUpdater & | updater | ) |
Updates the render components.
Referenced by instantiate(), and instantiate().
C3D_API void castor3d::Submesh::upload | ( | UploadData & | uploader | ) |
Updates the buffers.
|
friend |
|
friend |