Asset representing a 3D mesh. Handles CPU and GPU data, including vertex and index buffers.
More...
#include <MeshAsset.hpp>
|
| const Maths::Vec3f & | GetColor () const |
| | Returns the mesh color.
|
| void | SetColor (float r, float g, float b) |
| | Sets the mesh color.
|
| void | Load () override |
| | Loads the mesh from file and prepares CPU data.
|
| void | Unload () override |
| | Frees CPU and GPU resources.
|
| void | CreateBuffers (ID3D11Device *device) override |
| | Creates GPU vertex and index buffers.
|
| void | Bind (ID3D11DeviceContext *context) const override |
| | Binds the mesh buffers to the pipeline for rendering.
|
| bool | IsReady () const |
| | Checks if the mesh is ready to be rendered.
|
| UINT | GetIndexCount () const |
| | Returns the number of indices used for DrawIndexed.
|
| virtual | ~Asset ()=default |
| | Virtual destructor.
|
|
| std::vector< Vertex > | vertices |
| | Vertex data stored on CPU.
|
| std::vector< uint32_t > | indices |
| | Index data stored on CPU.
|
| wrl::ComPtr< ID3D11Buffer > | vertexBuffer = nullptr |
| | Vertex buffer on GPU.
|
| wrl::ComPtr< ID3D11Buffer > | indexBuffer = nullptr |
| | Index buffer on GPU.
|
| AssetID | id |
| | Unique identifier of the asset.
|
| std::string | path |
| | File path of the source asset.
|
Asset representing a 3D mesh. Handles CPU and GPU data, including vertex and index buffers.
◆ Bind()
| void MeshAsset::Bind |
( |
ID3D11DeviceContext * | context | ) |
const |
|
overridevirtual |
Binds the mesh buffers to the pipeline for rendering.
- Parameters
-
| context | Device context used for rendering |
Reimplemented from Asset.
◆ CreateBuffers()
| void MeshAsset::CreateBuffers |
( |
ID3D11Device * | device | ) |
|
|
overridevirtual |
Creates GPU vertex and index buffers.
- Parameters
-
| device | D3D11 device used for buffer creation |
Reimplemented from Asset.
◆ GetColor()
Returns the mesh color.
- Returns
- Current mesh color
◆ GetIndexCount()
| UINT MeshAsset::GetIndexCount |
( |
| ) |
const |
Returns the number of indices used for DrawIndexed.
- Returns
- Index count
◆ IsReady()
| bool MeshAsset::IsReady |
( |
| ) |
const |
Checks if the mesh is ready to be rendered.
- Returns
- True if GPU buffers are valid
◆ Load()
Loads the mesh from file and prepares CPU data.
Implements Asset.
◆ SetColor()
| void MeshAsset::SetColor |
( |
float | r, |
|
|
float | g, |
|
|
float | b ) |
|
inline |
Sets the mesh color.
- Parameters
-
| r | Red component (0..1) |
| g | Green component (0..1) |
| b | Blue component (0..1) |
◆ Unload()
| void MeshAsset::Unload |
( |
| ) |
|
|
overridevirtual |
Frees CPU and GPU resources.
Implements Asset.
◆ indexBuffer
| wrl::ComPtr<ID3D11Buffer> MeshAsset::indexBuffer = nullptr |
◆ indices
| std::vector<uint32_t> MeshAsset::indices |
Index data stored on CPU.
◆ vertexBuffer
| wrl::ComPtr<ID3D11Buffer> MeshAsset::vertexBuffer = nullptr |
◆ vertices
| std::vector<Vertex> MeshAsset::vertices |
The documentation for this class was generated from the following file: