![]() |
Lysa
0.0
Lysa 3D Engine
|
Inheritance diagram for MeshManager:Public Member Functions | |
| MeshManager (size_t capacity, size_t vertexCapacity, size_t indexCapacity, size_t surfaceCapacity) | |
| Mesh & | create (const std::vector< Vertex > &vertices, const std::vector< uint32 > &indices, const std::vector< MeshSurface > &surfaces, const std::string &name="") |
| Mesh & | create (const std::string &name="") |
| Mesh & | createQuad (float width, float height, unique_id material, MeshAlignment alignment=MeshAlignment::CENTER, float xOffset=0.f, float yOffset=0.f, const std::string &name="quad") |
| Mesh & | createTriangle (float width, float height, unique_id material, MeshAlignment alignment=MeshAlignment::CENTER, float xOffset=0.f, float yOffset=0.f, const std::string &name="triangle") |
| void | upload (unique_id id) |
| bool | isUploaded (const unique_id id) |
| void | flush () |
| auto | getMeshBuffer () const |
| auto | getMeshSurfaceBuffer () const |
| auto | getVertexBuffer () const |
| auto | getIndexBuffer () const |
| bool | destroy (unique_id id) override |
| bool | destroy (const Mesh &m) override |
Public Member Functions inherited from ResourcesManager< Mesh > | |
| ResourcesManager (ResourcesManager &) = delete | |
| Mesh & | create (Args &&...args) |
| void | destroy (const std::vector< unique_id > &ids) |
| void | forEach (Func &&func) |
| void | forEach (Func &&func) const |
| unique_id | getCapacity () const |
| bool | have (const unique_id id) const |
| ResourcesManager & | operator= (ResourcesManager &) = delete |
| Mesh & | operator[] (const unique_id id) |
| const Mesh & | operator[] (const unique_id id) const |
| void | use (const unique_id id) |
| virtual | ~ResourcesManager () |
Additional Inherited Members | |
Protected Member Functions inherited from ResourcesManager< Mesh > | |
| ResourcesManager (const size_t capacity, const std::string &name) | |
| Mesh & | allocate (std::unique_ptr< Mesh > instance) |
| bool | isFull () const |
Protected Attributes inherited from ResourcesManager< Mesh > | |
| std::vector< std::unique_ptr< Mesh > > | resources |
| std::mutex | resourcesMutex |
| MeshManager | ( | size_t | capacity, |
| size_t | vertexCapacity, | ||
| size_t | indexCapacity, | ||
| size_t | surfaceCapacity | ||
| ) |
Construct a new manager
| capacity | maximum capacity |
| vertexCapacity | |
| indexCapacity | |
| surfaceCapacity |
| Mesh& create | ( | const std::string & | name = "" | ) |
| Mesh& create | ( | const std::vector< Vertex > & | vertices, |
| const std::vector< uint32 > & | indices, | ||
| const std::vector< MeshSurface > & | surfaces, | ||
| const std::string & | name = "" |
||
| ) |
| Mesh& createQuad | ( | float | width, |
| float | height, | ||
| unique_id | material, | ||
| MeshAlignment | alignment = MeshAlignment::CENTER, |
||
| float | xOffset = 0.f, |
||
| float | yOffset = 0.f, |
||
| const std::string & | name = "quad" |
||
| ) |
Creates a QuadMesh (flat quad in the XY plane).
| width | Width along the X axis (world units) |
| height | Height along the Y axis (world units) |
| material | Material applied to the quad surface |
| alignment | CENTER: origin at horizontal center; LEFT: origin at left edge |
| xOffset | Horizontal offset applied to all vertices (shifts the quad left/right from origin) |
| yOffset | Vertical offset applied to all vertices (shifts the quad up/down from origin) |
| name | Resource name |
| Mesh& createTriangle | ( | float | width, |
| float | height, | ||
| unique_id | material, | ||
| MeshAlignment | alignment = MeshAlignment::CENTER, |
||
| float | xOffset = 0.f, |
||
| float | yOffset = 0.f, |
||
| const std::string & | name = "triangle" |
||
| ) |
Creates a TriangleMesh (flat triangle in the XY plane).
| width | Width of the base along the X axis (world units) |
| height | Height along the Y axis (world units) |
| material | Material applied to the triangle surface |
| alignment | CENTER: apex at horizontal center; LEFT: left base edge at origin |
| xOffset | Horizontal offset applied to all vertices |
| yOffset | Vertical offset applied to all vertices |
| name | Resource name |
|
inlineoverridevirtual |
Releases a resource by reference, decrementing its reference counter.
| res | Resource to destroy. |
Reimplemented from lysa::ResourcesManager< Mesh >::destroy()
|
overridevirtual |
Releases a resource by ID, decrementing its reference counter. The slot is returned to the free list only when the counter reaches zero.
| id | Unique identifier of the resource to destroy. |
Reimplemented from lysa::ResourcesManager< Mesh >::destroy()
| void flush | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void upload | ( | unique_id | id | ) |