The JEMeshBufferManager.
More...
#include <MeshBufferManager.h>
The JEMeshBufferManager.
Class that manages all mesh buffer data, from loading to access. Provides convenience functions such as creating Mesh Components (for usage with the Joe Engine's entity-component system) and updating mesh buffers.
◆ JEMeshBufferManager()
JoeEngine::JEMeshBufferManager::JEMeshBufferManager |
( |
| ) |
|
|
inline |
Default constructor. Initializes member variables and reserve data for each member list.
◆ ~JEMeshBufferManager()
JoeEngine::JEMeshBufferManager::~JEMeshBufferManager |
( |
| ) |
|
|
default |
◆ Cleanup()
void JoeEngine::JEMeshBufferManager::Cleanup |
( |
| ) |
|
Cleanup all Vulkan objects and memory.
◆ CreateMeshComponent() [1/3]
MeshComponent JoeEngine::JEMeshBufferManager::CreateMeshComponent |
( |
const std::string & |
filepath | ) |
|
Create a new Mesh Component.
- Parameters
-
filepath | the mesh file source path. |
- Returns
- a new Mesh Component.
◆ CreateMeshComponent() [2/3]
MeshComponent JoeEngine::JEMeshBufferManager::CreateMeshComponent |
( |
const std::vector< JEMeshPointVertex > & |
vertices, |
|
|
const std::vector< uint32_t > & |
indices |
|
) |
| |
Create a new Mesh Component from existing vertex and index lists.
- Parameters
-
vertices | the existing list of point mesh vertices. |
indices | the existing list of mesh indices. |
◆ CreateMeshComponent() [3/3]
MeshComponent JoeEngine::JEMeshBufferManager::CreateMeshComponent |
( |
const std::vector< JEMeshVertex > & |
vertices, |
|
|
const std::vector< uint32_t > & |
indices |
|
) |
| |
Create a new Mesh Component from existing vertex and index lists.
- Parameters
-
vertices | the existing list of triangle mesh vertices. |
indices | the existing list of mesh indices. |
◆ ExpandMemberLists()
void JoeEngine::JEMeshBufferManager::ExpandMemberLists |
( |
| ) |
|
Preps member lists for new data.
◆ GetBoundingBoxData()
const std::vector<BoundingBoxData>& JoeEngine::JEMeshBufferManager::GetBoundingBoxData |
( |
| ) |
const |
|
inline |
Get all bounding box data.
Returns the member list of all bounding box data.
- Returns
- const-reference to the list of all bounding box data.
◆ GetBoundingBoxMesh()
const JESingleMesh& JoeEngine::JEMeshBufferManager::GetBoundingBoxMesh |
( |
| ) |
const |
|
inline |
Get the single-instance bounding box mesh struct data.
◆ GetIndexBufferAt()
const VkBuffer& JoeEngine::JEMeshBufferManager::GetIndexBufferAt |
( |
int |
index | ) |
const |
|
inline |
Get index buffer at index.
Returns the index buffer corresponding to the given index / mesh buffer ID.
- Parameters
-
index | the mesh ID whose index buffer to return. |
- Returns
- the index buffer corresponding to the index.
◆ GetIndexListAt()
const std::vector<uint32_t>& JoeEngine::JEMeshBufferManager::GetIndexListAt |
( |
int |
index | ) |
const |
|
inline |
Get index list at index.
Returns the index list corresponding to the given index / mesh buffer ID.
- Parameters
-
index | the mesh ID whose index list to return. |
- Returns
- the index list corresponding to the index.
◆ GetScreenSpaceTriMesh()
const JESingleMesh& JoeEngine::JEMeshBufferManager::GetScreenSpaceTriMesh |
( |
| ) |
const |
|
inline |
Get the single-instance screen-space triangle mesh struct data.
◆ GetVertexBufferAt()
const VkBuffer& JoeEngine::JEMeshBufferManager::GetVertexBufferAt |
( |
int |
index | ) |
const |
|
inline |
Get vertex buffer at index.
Returns the vertex buffer corresponding to the given index / mesh buffer ID.
- Parameters
-
index | the mesh ID whose vertex buffer to return. |
- Returns
- the vertex buffer corresponding to the index.
◆ Initialize()
void JoeEngine::JEMeshBufferManager::Initialize |
( |
VkPhysicalDevice |
physicalDevice, |
|
|
VkDevice |
device, |
|
|
VkCommandPool |
commandPool, |
|
|
const JEVulkanQueue & |
graphicsQueue |
|
) |
| |
Initialization.
- Parameters
-
physicalDevice | the Vulkan physical device. |
device | the Vulkan logical device. |
commandPool | the Vulkan command pool. |
graphicsQueue | the Vulkan graphics queue. |
◆ UpdateMeshBuffer() [1/2]
void JoeEngine::JEMeshBufferManager::UpdateMeshBuffer |
( |
uint32_t |
bufferId, |
|
|
const std::vector< JEMeshPointVertex > & |
vertices, |
|
|
const std::vector< uint32_t > & |
indices |
|
) |
| |
Update a mesh buffer to a new list of vertices and indices.
- Parameters
-
bufferId | the ID of the mesh buffer to update. |
vertices | the new list of point mesh vertices. |
indices | the new list of mesh indices. |
◆ UpdateMeshBuffer() [2/2]
void JoeEngine::JEMeshBufferManager::UpdateMeshBuffer |
( |
uint32_t |
bufferId, |
|
|
const std::vector< JEMeshVertex > & |
vertices, |
|
|
const std::vector< uint32_t > & |
indices |
|
) |
| |
Update a mesh buffer to a new list of vertices and indices.
- Parameters
-
bufferId | the ID of the mesh buffer to update. |
vertices | the new list of triangle mesh vertices. |
indices | the new list of mesh indices. |
The documentation for this class was generated from the following files: