#include <Subdivider.hpp>
|
C3D_API uint32_t | doSubdivideThreaded () |
| Threaded subdivision function. More...
|
|
C3D_API SubmeshVertex & | doTryAddPoint (castor::Point3f const &position) |
| Checks if the given position is in my list and if not creates and adds it. More...
|
|
virtual C3D_API void | doSubdivideOnce (SubmeshSPtr submesh, bool generateBuffers, bool threaded) |
| Main subdivision function. More...
|
|
virtual C3D_API void | doInitialise () |
| Initialisation function. More...
|
|
virtual C3D_API void | doAddGeneratedFaces ()=0 |
| Adds generated faces to the submesh. More...
|
|
C3D_API void | doSwapBuffers () |
| Swaps the internal faces with the submeshes ones. More...
|
|
virtual C3D_API void | doSubdivide ()=0 |
| Effectively subdivides the submesh. More...
|
|
C3D_API void | doSetTextCoords (SubmeshVertex const &a, SubmeshVertex const &b, SubmeshVertex const &c, SubmeshVertex &d, SubmeshVertex &e, SubmeshVertex &f) |
| Computes the texture coordinates for given vertices, creates the faces. More...
|
|
C3D_API void | doSetTextCoords (SubmeshVertex const &a, SubmeshVertex const &b, SubmeshVertex const &c, SubmeshVertex &p) |
| Computes the texture coordinates for the new vertex, creates the faces. More...
|
|
◆ MeshSubdivisionEndFunction
◆ MeshSubdivider()
C3D_API castor3d::MeshSubdivider::MeshSubdivider |
( |
| ) |
|
◆ ~MeshSubdivider()
virtual C3D_API castor3d::MeshSubdivider::~MeshSubdivider |
( |
| ) |
|
|
virtual |
◆ addFace()
virtual C3D_API Face castor3d::MeshSubdivider::addFace |
( |
uint32_t |
a, |
|
|
uint32_t |
b, |
|
|
uint32_t |
c |
|
) |
| |
|
virtual |
Creates and adds a face.
- Parameters
-
[in] | a | The first face's vertex index |
[in] | b | The second face's vertex index |
[in] | c | The third face's vertex index |
- Returns
- The created face
◆ addPoint() [1/3]
adds a vertex to my list
- Parameters
-
[in] | position | The vertex to add |
- Returns
- The created vertex
◆ addPoint() [2/3]
Creates and adds a vertex to my list.
- Parameters
-
[in] | position | The vertex coordinates |
- Returns
- The created vertex
◆ addPoint() [3/3]
Creates and adds a vertex to my list.
- Parameters
-
[in] | x,y,z | The vertex coordinates |
- Returns
- The created vertex
◆ cleanup()
virtual C3D_API void castor3d::MeshSubdivider::cleanup |
( |
| ) |
|
|
virtual |
Cleans all member variables.
◆ doAddGeneratedFaces()
virtual C3D_API void castor3d::MeshSubdivider::doAddGeneratedFaces |
( |
| ) |
|
|
protectedpure virtual |
Adds generated faces to the submesh.
◆ doInitialise()
virtual C3D_API void castor3d::MeshSubdivider::doInitialise |
( |
| ) |
|
|
protectedvirtual |
◆ doSetTextCoords() [1/2]
Computes the texture coordinates for given vertices, creates the faces.
- Parameters
-
[in] | a,b,c | The source vertices |
[out] | d,e,f | The new vertices |
◆ doSetTextCoords() [2/2]
Computes the texture coordinates for the new vertex, creates the faces.
- Parameters
-
[in] | a,b,c | The source vertices |
[out] | p | The new vertex |
◆ doSubdivide()
virtual C3D_API void castor3d::MeshSubdivider::doSubdivide |
( |
| ) |
|
|
protectedpure virtual |
Effectively subdivides the submesh.
◆ doSubdivideOnce()
virtual C3D_API void castor3d::MeshSubdivider::doSubdivideOnce |
( |
SubmeshSPtr |
submesh, |
|
|
bool |
generateBuffers, |
|
|
bool |
threaded |
|
) |
| |
|
protectedvirtual |
Main subdivision function.
- Parameters
-
[in] | submesh | The submesh to subdivide |
[in] | generateBuffers | Tells if the buffers must be generated after subdivision |
[in] | threaded | Tells if subdivision must be threaded |
◆ doSubdivideThreaded()
C3D_API uint32_t castor3d::MeshSubdivider::doSubdivideThreaded |
( |
| ) |
|
|
protected |
Threaded subdivision function.
◆ doSwapBuffers()
C3D_API void castor3d::MeshSubdivider::doSwapBuffers |
( |
| ) |
|
|
protected |
Swaps the internal faces with the submeshes ones.
◆ doTryAddPoint()
Checks if the given position is in my list and if not creates and adds it.
- Parameters
-
[in] | position | The vertex coordinates |
- Returns
- The created vertex
◆ getPoint()
Retrieves the wanted position.
- Parameters
-
- Returns
- The value
◆ getPoints()
- Returns
- Retrieves the points array
◆ getPointsCount()
C3D_API uint32_t castor3d::MeshSubdivider::getPointsCount |
( |
| ) |
const |
Retrieves the points count.
- Returns
- The value
◆ isInMyPoints()
virtual C3D_API int castor3d::MeshSubdivider::isInMyPoints |
( |
castor::Point3f const & |
vertex, |
|
|
double |
precision |
|
) |
| |
|
virtual |
Tests if the given Point3f is in mine.
- Parameters
-
[in] | vertex | The vertex to test |
[in] | precision | The comparison precision |
- Returns
- The index of the vertex equal to parameter, -1 if not found
◆ setSubdivisionEndCallback()
Defines a function to execute when the threaded subdivision ends.
- Parameters
-
[in] | subdivisionEndFunc | Pointer over the function to execute |
References m_onSubdivisionEnd.
◆ subdivide()
virtual C3D_API void castor3d::MeshSubdivider::subdivide |
( |
SubmeshSPtr |
submesh, |
|
|
int |
occurences, |
|
|
bool |
generateBuffers = true , |
|
|
bool |
threaded = false |
|
) |
| |
|
virtual |
Main subdivision function.
- Parameters
-
[in] | submesh | The submesh to subdivide |
[in] | occurences | The subdivisions occurences |
[in] | generateBuffers | Tells if the buffers must be generated after subdivision |
[in] | threaded | Tells if subdivision must be threaded |
◆ m_arrayFaces
FaceArray castor3d::MeshSubdivider::m_arrayFaces |
|
protected |
◆ m_generateBuffers
bool castor3d::MeshSubdivider::m_generateBuffers |
|
protected |
Tells if the buffers must be generated.
◆ m_mutex
std::recursive_mutex castor3d::MeshSubdivider::m_mutex |
|
protected |
The subdivision thread mutex.
◆ m_onSubdivisionEnd
◆ m_points
std::vector< std::unique_ptr< SubmeshVertex > > castor3d::MeshSubdivider::m_points |
|
protected |
◆ m_submesh
SubmeshSPtr castor3d::MeshSubdivider::m_submesh |
|
protected |
The submesh being subdivided.
◆ m_thread
std::shared_ptr< std::thread > castor3d::MeshSubdivider::m_thread |
|
protected |
◆ m_threaded
bool castor3d::MeshSubdivider::m_threaded |
|
protected |
Tells that the subdivision is threaded.
The documentation for this class was generated from the following file: