|
Aeon Engine c550894
AeonGames Open Source Game Engine
|
Represents a polygon mesh with vertex attributes and index data. More...
#include <aeongames/Mesh.hpp>


Public Types | |
| enum | AttributeSemantic : uint32_t { POSITION = "VertexPosition"_crc32 , NORMAL = "VertexNormal"_crc32 , TANGENT = "VertexTangent"_crc32 , BITANGENT = "VertexBitangent"_crc32 , TEXCOORD = "VertexUV"_crc32 , WEIGHT_INDEX = "VertexWeightIndices"_crc32 , WEIGHT_VALUE = "VertexWeights"_crc32 , COLOR = "VertexColor"_crc32 } |
| Semantic meaning of a vertex attribute, identified by CRC32 of its name. More... | |
| enum | AttributeType : uint8_t { BYTE = 0 , UNSIGNED_BYTE = 1 , SHORT = 2 , UNSIGNED_SHORT = 3 , HALF_FLOAT = 4 , INT = 5 , UNSIGNED_INT = 6 , FLOAT = 7 , FIXED = 8 , DOUBLE = 9 } |
| Data type of a vertex attribute component. More... | |
| enum | AttributeFlag : uint8_t { NORMALIZED = 0b00000001 , INTEGER = 0b00000010 } |
| Flags that modify how a vertex attribute is interpreted. More... | |
| enum | BindingLocations : uint32_t { MATRICES = "Matrices"_crc32 , MATERIAL = "Material"_crc32 , SKELETON = "Skeleton"_crc32 , SAMPLERS = "Samplers"_crc32 } |
| CRC32-based binding location identifiers for descriptor sets. More... | |
| using | AttributeSize = uint8_t |
| Type alias for the number of components in a vertex attribute. | |
| using | AttributeFlags = uint8_t |
| Type alias for vertex attribute flag bits. | |
| using | AttributeTuple = std::tuple<AttributeSemantic, AttributeSize, AttributeType, AttributeFlags> |
| Tuple describing a single vertex attribute (semantic, component count, type, flags). | |
Public Member Functions | |
| DLL | Mesh () |
| Default constructor. | |
| DLL | ~Mesh () final |
| Destructor. | |
| DLL void | LoadFromPBMsg (const MeshMsg &aMeshMsg) |
| Load mesh data from a protobuf message. | |
| DLL void | LoadFromMemory (const void *aBuffer, size_t aBufferSize) final |
| Load mesh data from a raw memory buffer. | |
| DLL void | Unload () final |
| Unload mesh data and release resources. | |
| DLL const std::vector< AttributeTuple > & | GetAttributes () const |
| Get the list of vertex attributes. | |
| DLL uint32_t | GetIndexSize () const |
| Get the size in bytes of a single index. | |
| DLL uint32_t | GetIndexCount () const |
| Get the total number of indices. | |
| DLL uint32_t | GetVertexCount () const |
| Get the total number of vertices. | |
| DLL const std::vector< uint8_t > & | GetVertexBuffer () const |
| Get the raw vertex data buffer. | |
| DLL const std::vector< uint8_t > & | GetIndexBuffer () const |
| Get the raw index data buffer. | |
| DLL const AABB & | GetAABB () const |
| Get the axis-aligned bounding box of the mesh. | |
| DLL size_t | GetStride () const |
| Get the stride (bytes per vertex) for the vertex buffer. | |
| Public Member Functions inherited from AeonGames::Resource | |
| virtual | ~Resource () |
| Virtual destructor. | |
| DLL void | LoadFromId (uint32_t aId) |
| Load the resource identified by a numeric id. | |
| DLL void | LoadFromFile (const std::string &aFilename) |
| Load the resource from a file on disk. | |
| DLL size_t | GetConsecutiveId () const |
| Get the Consecutive Id for the resource object. | |
Represents a polygon mesh with vertex attributes and index data.
| using AeonGames::Mesh::AttributeFlags = uint8_t |
| using AeonGames::Mesh::AttributeSize = uint8_t |
| using AeonGames::Mesh::AttributeTuple = std::tuple<AttributeSemantic, AttributeSize, AttributeType, AttributeFlags> |
| enum AeonGames::Mesh::AttributeFlag : uint8_t |
| enum AeonGames::Mesh::AttributeSemantic : uint32_t |
Semantic meaning of a vertex attribute, identified by CRC32 of its name.
| Enumerator | |
|---|---|
| POSITION | Vertex position. |
| NORMAL | Vertex normal. |
| TANGENT | Vertex tangent. |
| BITANGENT | Vertex bitangent. |
| TEXCOORD | Texture coordinate. |
| WEIGHT_INDEX | Bone weight indices. |
| WEIGHT_VALUE | Bone weight values. |
| COLOR | Vertex color. |
| enum AeonGames::Mesh::AttributeType : uint8_t |
Data type of a vertex attribute component.
| enum AeonGames::Mesh::BindingLocations : uint32_t |
| const AABB & AeonGames::Mesh::GetAABB | ( | ) | const |
| const std::vector< Mesh::AttributeTuple > & AeonGames::Mesh::GetAttributes | ( | ) | const |
| const std::vector< uint8_t > & AeonGames::Mesh::GetIndexBuffer | ( | ) | const |
| uint32_t AeonGames::Mesh::GetIndexCount | ( | ) | const |
| uint32_t AeonGames::Mesh::GetIndexSize | ( | ) | const |
| size_t AeonGames::Mesh::GetStride | ( | ) | const |
| const std::vector< uint8_t > & AeonGames::Mesh::GetVertexBuffer | ( | ) | const |
| uint32_t AeonGames::Mesh::GetVertexCount | ( | ) | const |
|
finalvirtual |
Load mesh data from a raw memory buffer.
| aBuffer | Pointer to the buffer. |
| aBufferSize | Size of the buffer in bytes. |
Implements AeonGames::Resource.
| void AeonGames::Mesh::LoadFromPBMsg | ( | const MeshMsg & | aMeshMsg | ) |
|
finalvirtual |
Unload mesh data and release resources.
Implements AeonGames::Resource.