![]() |
Castor3D 0.12.0
Multiplatform 3D engine
|
#include <Submesh.hpp>
Public Member Functions | |
C3D_API | Submesh (Mesh &mesh, uint32_t id=1) |
Constructor. More... | |
C3D_API | ~Submesh () |
Destructor. More... | |
C3D_API void | initialise (RenderDevice const &device) |
Initialises the submesh. More... | |
C3D_API void | cleanup (RenderDevice const &device) |
Cleans the submesh. More... | |
C3D_API void | update () |
Updates the buffers. More... | |
C3D_API void | computeContainers () |
Computes the containers (cube and sphere) More... | |
C3D_API void | updateContainers (castor::BoundingBox const &boundingBox) |
Updates containers from given bounding box. More... | |
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. More... | |
C3D_API InterleavedVertex | addPoint (float x, float y, float z) |
Creates and Adds a vertex to my list. More... | |
C3D_API InterleavedVertex | addPoint (castor::Point3f const &value) |
Adds a vertex to my list. More... | |
C3D_API InterleavedVertex | addPoint (float *value) |
Creates and Adds a vertex to my list. More... | |
C3D_API void | addPoint (InterleavedVertex const &value) |
Adds a vertex to the list. More... | |
C3D_API void | addPoints (InterleavedVertex const *const begin, InterleavedVertex const *const end) |
Adds a points list to my list. More... | |
C3D_API void | computeNormals (bool reverted=false) |
Generates normals and tangents. More... | |
C3D_API void | sortByDistance (castor::Point3f const &cameraPosition) |
Sorts the face from farthest to nearest from the camera. More... | |
C3D_API ProgramFlags | getProgramFlags (MaterialRPtr material) const |
C3D_API void | setMaterial (MaterialRPtr oldMaterial, MaterialRPtr newMaterial, bool update) |
Sets the material. More... | |
C3D_API GeometryBuffers const & | getGeometryBuffers (ShaderFlags const &shaderFlags, ProgramFlags const &programFlags, MaterialRPtr material, TextureFlagsArray const &mask, bool forceTexcoords) const |
void | addPoints (std::vector< InterleavedVertex > const &vertices) |
Adds a points list to my list. More... | |
template<size_t Count> | |
void | addPoints (std::array< InterleavedVertex, Count > const &vertices) |
Adds a points list to my list. More... | |
void | setDefaultMaterial (MaterialRPtr material) |
Sets the material. More... | |
void | needsUpdate () |
Sets the submesh to be updated. More... | |
void | setIndexMapping (IndexMappingSPtr mapping) |
Sets the index mapping. More... | |
IndexMappingSPtr | getIndexMapping () const |
void | addComponent (castor::String const &name, SubmeshComponentSPtr component) |
Adds a component. More... | |
template<typename T > | |
void | addComponent (std::shared_ptr< T > component) |
Adds a component. More... | |
void | setTopology (VkPrimitiveTopology value) |
Sets the topology. More... | |
void | disableSceneUpdate () |
Disables scene update on modifications. More... | |
C3D_API void | enableSceneUpdate (bool updateScene) |
Enables scene update on modifications. More... | |
Friends | |
template<typename T > | |
struct | SubmeshComponentAdder |
class | BinaryWriter< Submesh > |
class | BinaryParser< Submesh > |
static uint32_t constexpr | Position = 0u |
static uint32_t constexpr | Normal = 1u |
static uint32_t constexpr | Tangent = 2u |
static uint32_t constexpr | Bitangent = 3u |
static uint32_t constexpr | Texture = 4u |
SkeletonSPtr | getSkeleton () const |
InterleavedVertex const & | operator[] (uint32_t index) const |
InterleavedVertex & | operator[] (uint32_t index) |
InterleavedVertex const & | getPoint (uint32_t index) const |
InterleavedVertex & | getPoint (uint32_t index) |
MaterialRPtr | getDefaultMaterial () const |
castor::BoundingBox const & | getBoundingBox () const |
castor::BoundingBox & | getBoundingBox () |
castor::BoundingSphere const & | getBoundingSphere () const |
castor::BoundingSphere & | getBoundingSphere () |
InterleavedVertexArray const & | getPoints () const |
InterleavedVertexArray & | getPoints () |
bool | hasBufferOffsets () const |
ObjectBufferOffset const & | getBufferOffsets () const |
bool | isInitialised () const |
bool | isDynamic () const |
Mesh const & | getParent () const |
Mesh & | getParent () |
uint32_t | getId () const |
bool | hasComponent (castor::String const &name) const |
SubmeshComponentSPtr | getComponent (castor::String const &name) const |
template<typename T > | |
std::shared_ptr< T > | getComponent () const |
InstantiationComponent & | getInstantiation () |
InstantiationComponent const & | getInstantiation () const |
SubmeshComponentIDMap const & | getComponents () const |
VkPrimitiveTopology | getTopology () const |
Constructor.
[in] | mesh | The parent mesh. |
[in] | id | The submesh ID. |
C3D_API castor3d::Submesh::~Submesh | ( | ) |
Destructor.
|
inline |
Adds a component.
[in] | name | The component name. |
[in] | component | The component. |
|
inline |
Adds a component.
[in] | component | The 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 * | 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. |
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. |
|
inline |
Adds a points list to my list.
[in] | vertices | The vertices |
|
inline |
Adds a points list to my list.
[in] | vertices | The vertices |
C3D_API void castor3d::Submesh::cleanup | ( | RenderDevice const & | device | ) |
Cleans the submesh.
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.
|
inline |
Disables scene update on modifications.
C3D_API void castor3d::Submesh::enableSceneUpdate | ( | bool | updateScene | ) |
Enables scene update on modifications.
[in] | updateScene | Tells if this call triggers a scene update. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API uint32_t castor3d::Submesh::getFaceCount | ( | ) | const |
C3D_API GeometryBuffers const & castor3d::Submesh::getGeometryBuffers | ( | ShaderFlags const & | shaderFlags, |
ProgramFlags const & | programFlags, | ||
MaterialRPtr | material, | ||
TextureFlagsArray const & | mask, | ||
bool | forceTexcoords | ||
) | const |
[in] | shaderFlags | The shader flags. |
[in] | programFlags | The program flags. |
[in] | material | The material. |
[in] | mask | The textures mask. |
[in] | forceTexcoords | true to force texture coordinates in the vertex layout. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API uint32_t castor3d::Submesh::getPointsCount | ( | ) | const |
C3D_API ProgramFlags castor3d::Submesh::getProgramFlags | ( | MaterialRPtr | material | ) | const |
|
inline |
name Getters.
|
inline |
|
inline |
|
inline |
C3D_API void castor3d::Submesh::initialise | ( | RenderDevice const & | device | ) |
Initialises the submesh.
|
inline |
|
inline |
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 |
|
inline |
Sets the submesh to be updated.
|
inline |
|
inline |
|
inline |
Sets the material.
[in] | material | The new value |
|
inline |
Sets the index mapping.
[in] | mapping | The mapping. |
C3D_API void castor3d::Submesh::setMaterial | ( | MaterialRPtr | oldMaterial, |
MaterialRPtr | newMaterial, | ||
bool | update | ||
) |
Sets the material.
[in] | oldMaterial | The old material. |
[in] | newMaterial | The new material. |
[in] | update | Tells if the buffers must be updated. |
|
inline |
Sets the topology.
[in] | value | The new value. |
C3D_API void castor3d::Submesh::sortByDistance | ( | castor::Point3f const & | cameraPosition | ) |
Sorts the face from farthest to nearest from the camera.
[in] | cameraPosition | The camera position, relative to submesh |
C3D_API void castor3d::Submesh::update | ( | ) |
Updates the buffers.
C3D_API void castor3d::Submesh::updateContainers | ( | castor::BoundingBox const & | boundingBox | ) |
Updates containers from given bounding box.
|
friend |
|
friend |
|
friend |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |