Stores polygon data and exposes GPU-ready vertex/index buffers.
More...
#include <spk_mesh.hpp>
|
|
using | Polygon = IPolygon<TVertex> |
| | Polygon type stored by the mesh.
|
|
using | EditionContract = ContractProvider::Contract |
| | Contract type returned by edition subscriptions.
|
|
using | EditionJob = ContractProvider::Job |
| | Job type invoked on mesh edits.
|
|
|
| IMesh () |
| | Builds an empty mesh with a dynamic buffer set.
|
| | IMesh (const IMesh &p_other) |
| | Copies polygon data into a new mesh instance.
|
| IMesh & | operator= (const IMesh &p_other) |
| | Assigns polygon data from another mesh.
|
| | IMesh (IMesh &&p_other) noexcept |
| | Moves polygon data from another mesh.
|
| IMesh & | operator= (IMesh &&p_other) noexcept |
| | Move-assigns polygon data from another mesh.
|
|
void | clear () |
| | Clears all polygons and notifies subscribers.
|
| void | append (const Polygon &p_shape) |
| | Appends a polygon and notifies subscribers.
|
| EditionContract | subscribeToEdition (const EditionJob &p_job) const |
| | Subscribes to mesh edition notifications.
|
| const std::vector< TVertex > & | vertices () const |
| | Returns the cached vertex list for all polygons.
|
| const std::vector< Polygon > & | polygons () const |
| | Returns the stored polygons.
|
| const std::vector< uint32_t > & | indexes () const |
| | Returns the cached triangle indices for the mesh.
|
| IMesh & | operator+= (const IMesh &p_other) |
| | Appends polygons from another mesh and notifies subscribers.
|
| const std::shared_ptr< spk::OpenGL::BufferSetObject > & | bufferSet () const |
| | Returns the underlying buffer set.
|
|
void | synchronize () const |
| | Updates GPU buffers when mesh data has changed.
|
| IMesh | fuze (const IMesh &p_other) const |
| | Returns a new mesh by concatenating another mesh.
|
|
| IMesh | operator+ (const IMesh< TVertex > &p_lhs, const IMesh< TVertex > &p_rhs) |
| | Returns a mesh that combines both operands.
|
template<typename TVertex>
class spk::IMesh< TVertex >
Stores polygon data and exposes GPU-ready vertex/index buffers.
- Template Parameters
-
| TVertex | Vertex type stored in polygons and buffers. |
- See also
- IPolygon
Stores polygon data and exposes GPU-ready vertex/index buffers.
Definition spk_mesh.hpp:29
void append(const Polygon &p_shape)
Appends a polygon and notifies subscribers.
Definition spk_mesh.hpp:270
void synchronize() const
Updates GPU buffers when mesh data has changed.
Definition spk_mesh.hpp:346
static IPolygon< TVertex > makeTriangle(const TVertex &p_a, const TVertex &p_b, const TVertex &p_c)
Creates a triangle polygon.
Definition spk_polygon.hpp:46
◆ IMesh() [1/2]
template<typename TVertex>
Copies polygon data into a new mesh instance.
- Parameters
-
| p_other | Mesh to copy from. |
◆ IMesh() [2/2]
template<typename TVertex>
Moves polygon data from another mesh.
- Parameters
-
| p_other | Mesh to move from. |
◆ append()
template<typename TVertex>
Appends a polygon and notifies subscribers.
- Parameters
-
◆ bufferSet()
template<typename TVertex>
Returns the underlying buffer set.
- Returns
- Shared pointer to the buffer set object.
◆ fuze()
template<typename TVertex>
Returns a new mesh by concatenating another mesh.
- Parameters
-
| p_other | Mesh to combine with. |
- Returns
- New mesh containing polygons from both meshes.
◆ indexes()
template<typename TVertex>
| const std::vector< uint32_t > & spk::IMesh< TVertex >::indexes |
( |
| ) |
const |
|
inline |
Returns the cached triangle indices for the mesh.
- Returns
- Index vector.
◆ operator+=()
template<typename TVertex>
Appends polygons from another mesh and notifies subscribers.
- Parameters
-
- Returns
- Reference to this mesh.
◆ operator=() [1/2]
template<typename TVertex>
Assigns polygon data from another mesh.
- Parameters
-
| p_other | Mesh to copy from. |
- Returns
- Reference to this mesh.
◆ operator=() [2/2]
template<typename TVertex>
Move-assigns polygon data from another mesh.
- Parameters
-
| p_other | Mesh to move from. |
- Returns
- Reference to this mesh.
◆ polygons()
template<typename TVertex>
Returns the stored polygons.
- Returns
- Polygon vector.
◆ subscribeToEdition()
template<typename TVertex>
Subscribes to mesh edition notifications.
- Parameters
-
| p_job | Callback executed when mesh data changes. |
- Returns
- Contract handle for the subscription.
◆ vertices()
template<typename TVertex>
| const std::vector< TVertex > & spk::IMesh< TVertex >::vertices |
( |
| ) |
const |
|
inline |
Returns the cached vertex list for all polygons.
- Returns
- Vertex vector.
◆ operator+
template<typename TVertex>
| IMesh operator+ |
( |
const IMesh< TVertex > & | p_lhs, |
|
|
const IMesh< TVertex > & | p_rhs ) |
|
friend |
Returns a mesh that combines both operands.
- Parameters
-
| p_lhs | Left mesh. |
| p_rhs | Right mesh. |
- Returns
- New mesh containing polygons from both meshes.
The documentation for this class was generated from the following file: