16#ifndef AEONGAMES_MESH_H
17#define AEONGAMES_MESH_H
23#include "aeongames/CRC.hpp"
24#include "aeongames/Resource.hpp"
82 using AttributeTuple = std::tuple<AttributeSemantic, AttributeSize, AttributeType, AttributeFlags>;
95 DLL
void LoadFromMemory ( const
void* aBuffer,
size_t aBufferSize ) final;
132 std::vector<uint8_t> mVertexBuffer{};
133 std::vector<uint8_t> mIndexBuffer{};
134 std::vector<AttributeTuple> mAttributes{};
135 uint32_t mVertexCount{};
136 uint32_t mIndexSize{};
137 uint32_t mIndexCount{};
Header for the axis aligned bounding box class.
Axis Aligned Bounding Box class.
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 size_t GetStride() const
Get the stride (bytes per vertex) for the vertex buffer.
AttributeSemantic
Semantic meaning of a vertex attribute, identified by CRC32 of its name.
@ WEIGHT_INDEX
Bone weight indices.
@ TEXCOORD
Texture coordinate.
@ BITANGENT
Vertex bitangent.
@ POSITION
Vertex position.
@ WEIGHT_VALUE
Bone weight values.
BindingLocations
CRC32-based binding location identifiers for descriptor sets.
@ MATRICES
Matrices binding.
@ SKELETON
Skeleton binding.
@ SAMPLERS
Samplers binding.
@ MATERIAL
Material binding.
DLL uint32_t GetIndexSize() const
Get the size in bytes of a single index.
DLL ~Mesh() final
Destructor.
DLL void LoadFromPBMsg(const MeshMsg &aMeshMsg)
Load mesh data from a protobuf message.
AttributeType
Data type of a vertex attribute component.
@ UNSIGNED_SHORT
Unsigned 16-bit integer.
@ HALF_FLOAT
16-bit floating point.
@ BYTE
Signed 8-bit integer.
@ DOUBLE
64-bit floating point.
@ SHORT
Signed 16-bit integer.
@ UNSIGNED_BYTE
Unsigned 8-bit integer.
@ FLOAT
32-bit floating point.
@ INT
Signed 32-bit integer.
@ UNSIGNED_INT
Unsigned 32-bit integer.
uint8_t AttributeSize
Type alias for the number of components in a vertex attribute.
std::tuple< AttributeSemantic, AttributeSize, AttributeType, AttributeFlags > AttributeTuple
Tuple describing a single vertex attribute (semantic, component count, type, flags).
AttributeFlag
Flags that modify how a vertex attribute is interpreted.
@ INTEGER
Values are passed as integers (no conversion).
@ NORMALIZED
Values are normalized to [0,1] or [-1,1].
DLL const AABB & GetAABB() const
Get the axis-aligned bounding box of the mesh.
DLL uint32_t GetIndexCount() const
Get the total number of indices.
uint8_t AttributeFlags
Type alias for vertex attribute flag bits.
DLL const std::vector< uint8_t > & GetIndexBuffer() const
Get the raw index data buffer.
DLL const std::vector< uint8_t > & GetVertexBuffer() const
Get the raw vertex data buffer.
DLL const std::vector< AttributeTuple > & GetAttributes() const
Get the list of vertex attributes.
DLL uint32_t GetVertexCount() const
Get the total number of vertices.
DLL Mesh()
Default constructor.
Base class for loadable engine resources.
<- This is here just for the literals
DLL size_t GetAttributeTotalSize(const Mesh::AttributeTuple &aAttributeTuple)
Compute the total byte size of a single vertex attribute.