225 .subMeshes =
std::
move(subMeshes),
226 .vertexDeclaration =
std::
move(vertexDeclaration),
239 .subMeshes =
std::
move(subMeshes),
240 .vertexDeclaration =
std::
move(vertexDeclaration),
241 .indexType = indexType,
253 .subMeshes =
std::
move(subMeshes),
254 .vertexDeclaration =
std::
move(vertexDeclaration),
321 .subMeshes =
std::
move(subMeshes),
322 .vertexDeclaration =
std::
move(vertexDeclaration),
335 .subMeshes =
std::
move(subMeshes),
336 .vertexDeclaration =
std::
move(vertexDeclaration),
337 .indexType = indexType,
349 .subMeshes =
std::
move(subMeshes),
350 .vertexDeclaration =
std::
move(vertexDeclaration),
#define CE_ASSERT(...)
Definition Macros.hpp:323
#define CE_META_CLASS_FRIEND(T)
Definition Forward.hpp:48
Definition GPUBufferObject.hpp:169
A mesh that is backed directly by a GPU vertex (and optionally an index buffer).
Definition Mesh.hpp:377
GPUIndexBuffer mIndexBuffer
The GPU index buffer.
Definition Mesh.hpp:386
const GPUIndexBuffer & getIndexBuffer() const noexcept
The GPU index buffer.
Definition Mesh.hpp:432
const GPUVertexBuffer & getVertexBuffer() const noexcept
The GPU vertex buffer.
Definition Mesh.hpp:429
GPUMesh(const GPUVertexBuffer &vertexBuffer, VertexDeclaration vertexDeclaration, Vector< SubMesh > subMeshes)
Creates a new GPUMesh from an existing vertex buffer.
ConstRawVertexBufferView getRawVertexBufferView() const final
Gets a raw view of the vertex buffer data.
Definition Mesh.hpp:422
GPUMesh(const GPUVertexBuffer &vertexBuffer, VertexDeclaration vertexDeclaration, const GPUIndexBuffer &indexBuffer, IndexType indexType, Vector< SubMesh > subMeshes)
Creates a new GPUMesh from an existing vertex and index buffers.
ConstRawIndexBufferView getRawIndexBufferView() const final
Gets a raw view of the index buffer data.
Definition Mesh.hpp:425
GPUMesh(const GPUVertexBuffer &vertexBuffer, const VertexDeclaration &vertexDeclaration, const GPUIndexBuffer &indexBuffer, const Vector< SubMesh > subMeshes)
Creates a new GPUMesh from an existing vertex and index buffers.
Definition Mesh.hpp:416
GPUVertexBuffer mVertexBuffer
The GPU vertex buffer.
Definition Mesh.hpp:383
Definition GPUBufferObject.hpp:126
MemoryMesh(MemoryView< const Byte > vertexBuffer, MemoryView< const Byte > indexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex and index buffers.
MemoryMesh(Vector< Byte > vertexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex buffer.
Vector< Byte > mIndexData
A vector containing the index data.
Definition Mesh.hpp:193
MemoryView< const Byte > getVertexBuffer() const noexcept
Definition Mesh.hpp:270
MemoryMesh(MemoryView< const Byte > vertexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex buffer.
MemoryMesh(Vector< Byte > vertexBuffer, VertexDeclaration vertexDeclaration, Vector< Byte > indexBuffer, const IndexType indexType, Vector< SubMesh > subMeshes)
Creates a new MemoryMesh from an existing vertex and index buffers.
Definition Mesh.hpp:235
MemoryMesh(Vector< Byte > vertexBuffer, Vector< Byte > indexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex and index buffers.
MemoryView< const Byte > getIndexBuffer() const noexcept
Definition Mesh.hpp:273
Vector< Byte > mVertexData
A vector containing the vertex data.
Definition Mesh.hpp:190
MemoryMesh(Vector< Byte > vertexBuffer, VertexDeclaration vertexDeclaration, Vector< SubMesh > subMeshes)
Creates a new MemoryMesh from an existing vertex buffer.
Definition Mesh.hpp:222
ConstRawVertexBufferView getRawVertexBufferView() const final
Gets a raw view of the vertex buffer data.
Definition Mesh.hpp:263
MemoryMesh(Vector< Byte > vertexBuffer, const VertexDeclaration &vertexDeclaration, Vector< Byte > indexBuffer, const Vector< SubMesh > subMeshes)
Creates a new MemoryMesh from an existing vertex and index buffers.
Definition Mesh.hpp:250
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition Mesh.hpp:278
ConstRawIndexBufferView getRawIndexBufferView() const final
Gets a raw view of the index buffer data.
Definition Mesh.hpp:266
A base class for all mesh implementations.
Definition Mesh.hpp:112
MeshProperties mProperties
A structure that contains a set of properties for the mesh.
Definition Mesh.hpp:118
Mesh(MeshProperties &&properties)
Creates a new Mesh by constructing a new MeshProperties object.
IndexBufferView< const T > getIndexBufferView() const
Gets a structured view of the index buffer data.
Definition Mesh.hpp:147
const AABox & getBoundingBox() const
The mesh axis-aligned bounding box, can be used to perform culling.
Definition Mesh.hpp:170
~Mesh() override
Destroys the mesh object.
const VertexDeclaration & getVertexDeclaration() const
The vertex declaration format used by the mesh.
Definition Mesh.hpp:161
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition Mesh.hpp:179
const MeshProperties & getProperties() const noexcept
A structure that contains a set of properties for the mesh.
Definition Mesh.hpp:155
virtual ConstRawVertexBufferView getRawVertexBufferView() const =0
Gets a raw view of the vertex buffer data.
const Sphere & getBoundingSphere() const
The mesh bounding sphere, can be used to perform culling.
Definition Mesh.hpp:167
void recalculateMeshBounds()
Recalculate the mesh bounds based on the sub-mesh bounds.
virtual ConstRawIndexBufferView getRawIndexBufferView() const =0
Gets a raw view of the index buffer data.
const Vector< SubMesh > & getSubMeshes() const
The sub meshes in the mesh.
Definition Mesh.hpp:158
Mesh()
Creates a new empty mesh.
const IndexType & getIndexType() const
The format used by the mesh index buffer, if an index buffer is available.
Definition Mesh.hpp:164
VertexBufferView< const T > getVertexBufferView() const
Gets a structured view of the vertex buffer data.
Definition Mesh.hpp:136
A mesh that stores it's vertex and index streams to a resource stream.
Definition Mesh.hpp:287
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition Mesh.hpp:371
ConstRawVertexBufferView getRawVertexBufferView() const final
Gets a raw view of the vertex buffer data.
Definition Mesh.hpp:356
ConstRawIndexBufferView getRawIndexBufferView() const final
Gets a raw view of the index buffer data.
Definition Mesh.hpp:359
StreamingMesh(Vector< Byte > vertexBuffer, VertexDeclaration vertexDeclaration, Vector< Byte > indexBuffer, const IndexType indexType, Vector< SubMesh > subMeshes)
Creates a new MemoryMesh from an existing vertex and index buffers.
Definition Mesh.hpp:331
MemoryView< const Byte > getVertexBuffer() const noexcept
Definition Mesh.hpp:363
StreamingMesh(Vector< Byte > vertexBuffer, Vector< Byte > indexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex and index buffers.
StreamingMesh(Vector< Byte > vertexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex buffer.
StreamingMesh(MemoryView< const Byte > vertexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex buffer.
StreamingMesh(MemoryView< const Byte > vertexBuffer, MemoryView< const Byte > indexBuffer, MeshProperties &&properties)
Creates a new MemoryMesh from an existing vertex and index buffers.
StreamingMesh(Vector< Byte > vertexBuffer, VertexDeclaration vertexDeclaration, Vector< SubMesh > subMeshes)
Creates a new MemoryMesh from an existing vertex buffer.
Definition Mesh.hpp:318
StreamingMesh(Vector< Byte > vertexBuffer, const VertexDeclaration &vertexDeclaration, Vector< Byte > indexBuffer, const Vector< SubMesh > subMeshes)
Creates a new MemoryMesh from an existing vertex and index buffers.
Definition Mesh.hpp:346
MemoryView< const Byte > getIndexBuffer() const noexcept
Definition Mesh.hpp:366
A memory view is a class which attaches to an chunk of memory and provides a view to it (optionally c...
Definition MemoryView.hpp:439
Utility template class that can be extended by Resources to automatically implement methods that are ...
Definition Resource.hpp:272
Definition Application.hpp:19
unsigned int VertexCount
A type that represents the number vertices in a mesh.
Definition Mesh.hpp:40
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
auto move(Vector3 position)
Moves a entity to the given position.
Definition Helpers.hpp:22
unsigned int VertexIndex
A type that represents a vertex index.
Definition Mesh.hpp:43
MemoryView< const Byte > ConstRawVertexBufferView
Definition Mesh.hpp:28
MemoryView< const Byte > ConstRawIndexBufferView
Definition Mesh.hpp:34
std::uint32_t UInt32
Definition DataTypes.hpp:23
Vector< VertexIndex > VertexIndexSet
A type that represents a set of vertex indexes.
Definition Mesh.hpp:48
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition IndexType.hpp:20
@ UInt32
The index buffer is represented as a 32-bit unsigned integer.
Definition IndexType.hpp:26
std::size_t getSize() const noexcept
Gets the size of index.
A structure that describes properties of a mesh.
Definition Mesh.hpp:86
VertexCount vertexCount
The total number of vertices (or indices) in the mesh.
Definition Mesh.hpp:88
IndexType indexType
The format used by the mesh index buffer, if an index buffer is available.
Definition Mesh.hpp:97
Sphere boundingSphere
The mesh bounding sphere, can be used to perform culling.
Definition Mesh.hpp:100
AABox boundingBox
The mesh axis-aligned bounding box, can be used to perform culling.
Definition Mesh.hpp:103
VertexDeclaration vertexDeclaration
The vertex declaration format used by the mesh.
Definition Mesh.hpp:94
Vector< SubMesh > subMeshes
The sub meshes in the mesh.
Definition Mesh.hpp:91
Primitive topology enumeration.
Definition PrimitiveTopology.hpp:21
@ Triangles
Triangle list, where each set of three vertices represent a single triangle primitive.
Definition PrimitiveTopology.hpp:50
AABox boundingBox
The sub-mesh axis-aligned bounding box, can be used to perform culling.
Definition Mesh.hpp:82
PrimitiveTopology primitiveTopology
The primitive topology used to render the sub-mesh.
Definition Mesh.hpp:76
VertexCount indexCount
The number of indexes in the sub mesh.
Definition Mesh.hpp:73
UInt32 indexOffset
The offset of the sub mesh as an offset of the mesh index buffer.
Definition Mesh.hpp:70
Sphere boundingSphere
The sub-mesh bounding sphere, can be used to perform culling.
Definition Mesh.hpp:79
Determines how vertices are laid-out on a vertex buffer or a mesh data.
Definition VertexDeclaration.hpp:205
std::size_t getSize() const noexcept
Computes the size of a single vertex, in bytes.
A basic vertex type.
Definition Mesh.hpp:51
Vector3f position
The vertex position.
Definition Mesh.hpp:53
Vector3f bitangent
The vertex bitangent vector.
Definition Mesh.hpp:65
Vector3f normal
The vertex normal vector.
Definition Mesh.hpp:56
Vector2f texCoords
The vertex texture coordinates.
Definition Mesh.hpp:59
Vector3f tangent
The vertex tangent vector.
Definition Mesh.hpp:62