CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::MemoryMesh Class Referencefinal

#include <CeresEngine/Mesh/Mesh.hpp>

Inheritance diagram for CeresEngine::MemoryMesh:
CeresEngine::TResource< MemoryMesh, Mesh > CeresEngine::Mesh CeresEngine::TResource< Mesh > CeresEngine::Resource CeresEngine::IReflectable

Public Member Functions

 MemoryMesh (Vector< Byte > vertexBuffer, MeshProperties &&properties)
 Creates a new MemoryMesh from an existing vertex buffer.
 
 MemoryMesh (Vector< Byte > vertexBuffer, Vector< Byte > indexBuffer, MeshProperties &&properties)
 Creates a new MemoryMesh from an existing vertex and index buffers.
 
 MemoryMesh (MemoryView< const Byte > vertexBuffer, MeshProperties &&properties)
 Creates a new MemoryMesh from an existing vertex buffer.
 
 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, VertexDeclaration vertexDeclaration, Vector< SubMesh > subMeshes)
 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.
 
 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.
 
ConstRawVertexBufferView getRawVertexBufferView () const final
 Gets a raw view of the vertex buffer data.
 
ConstRawIndexBufferView getRawIndexBufferView () const final
 Gets a raw view of the index buffer data.
 
MemoryView< const BytegetVertexBuffer () const noexcept
 
MemoryView< const BytegetIndexBuffer () const noexcept
 
- Public Member Functions inherited from CeresEngine::TResource< MemoryMesh, Mesh >
ResourceHandle< MemoryMeshgetResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< MemoryMeshgetShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const MemoryMeshgetShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () const noexcept override
 Returns the resource type information descriptor.
 
 TResource (ResourceData &data, InputStream &dataStream)
 
void serialize (OutputStream &dataStream) const override
 Serializes a resource by writing data to dataStream.
 
- Public Member Functions inherited from CeresEngine::Mesh
 Mesh ()
 Creates a new empty mesh.
 
 Mesh (MeshProperties &&properties)
 Creates a new Mesh by constructing a new MeshProperties object.
 
 ~Mesh () override
 Destroys the mesh object.
 
template<typename T >
VertexBufferView< const TgetVertexBufferView () const
 Gets a structured view of the vertex buffer data.
 
template<typename T >
IndexBufferView< const TgetIndexBufferView () const
 Gets a structured view of the index buffer data.
 
const MeshPropertiesgetProperties () const noexcept
 A structure that contains a set of properties for the mesh.
 
const Vector< SubMesh > & getSubMeshes () const
 The sub meshes in the mesh.
 
const VertexDeclarationgetVertexDeclaration () const
 The vertex declaration format used by the mesh.
 
const IndexTypegetIndexType () const
 The format used by the mesh index buffer, if an index buffer is available.
 
const Sphere & getBoundingSphere () const
 The mesh bounding sphere, can be used to perform culling.
 
const AABox & getBoundingBox () const
 The mesh axis-aligned bounding box, can be used to perform culling.
 
- Public Member Functions inherited from CeresEngine::TResource< Mesh >
ResourceHandle< MeshgetResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< MeshgetShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const MeshgetShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () const noexcept override
 Returns the resource type information descriptor.
 
 TResource (ResourceData &data, InputStream &dataStream)
 
void serialize (OutputStream &dataStream) const override
 Serializes a resource by writing data to dataStream.
 
- Public Member Functions inherited from CeresEngine::Resource
 Resource ()
 Default constructor for the Resource class.
 
 Resource (ResourceData &data)
 Creates a new Resource instance by passing a ResourceData instance.
 
virtual ~Resource () noexcept=default
 Resource virtual destructor.
 
ResourceManagergetResourceManager () const noexcept
 
HResource getResourceHandle () const noexcept
 Generates a hash for the provided type.
 
UUID getResourceID () const noexcept
 
HResource getParentResource () const noexcept
 A parent resource to which this resource is attached to.
 
SPtr< ResourceMetadatagetResourceMetadata () const noexcept
 A pointer to the user-defined resource metadata.
 
const PackagePtrgetPackage () const noexcept
 The package from which the resource was loaded from.
 
template<typename T = Resource>
SPtr< TgetShared () noexcept
 Gets a shared pointer to the resource.
 
template<typename T = Resource>
SPtr< const TgetShared () const noexcept
 Gets a shared pointer to the resource.
 
 Resource (ResourceData &data, InputStream &dataStream)
 Creates a new resource by reading data from dataStream.
 
- Public Member Functions inherited from CeresEngine::IReflectable
virtual ~IReflectable () noexcept=default
 

Static Public Member Functions

template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 
- Static Public Member Functions inherited from CeresEngine::Mesh
template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 
- Static Public Member Functions inherited from CeresEngine::Resource
template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Public Attributes

Vector< BytemVertexData
 A vector containing the vertex data.
 
Vector< BytemIndexData
 A vector containing the index data.
 
- Public Attributes inherited from CeresEngine::Mesh
MeshProperties mProperties
 A structure that contains a set of properties for the mesh.
 

Private Types

using super = TResource< MemoryMesh, Mesh >
 

Private Member Functions

 MemoryMesh ()=default
 

Friends

class TUserTypeInfo< MemoryMesh >
 

Additional Inherited Members

- Protected Member Functions inherited from CeresEngine::Mesh
void recalculateMeshBounds ()
 Recalculate the mesh bounds based on the sub-mesh bounds.
 
- Protected Member Functions inherited from CeresEngine::Resource
HResourceStream createStream (const ResourceStreamFlags &flags=ResourceStreamFlag::Default)
 Creates a new resource stream.
 
void destroyStream (HResourceStream &stream)
 Destroys a stream.
 
void markAsDirty ()
 Marks the resource as dirty.
 

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ MemoryMesh() [1/8]

CeresEngine::MemoryMesh::MemoryMesh ( Vector< Byte vertexBuffer,
MeshProperties &&  properties 
)
explicit

Creates a new MemoryMesh from an existing vertex buffer.

Parameters
vertexBufferThe vertex buffer to create the mesh from.
propertiesThe mesh properties data.

◆ MemoryMesh() [2/8]

CeresEngine::MemoryMesh::MemoryMesh ( Vector< Byte vertexBuffer,
Vector< Byte indexBuffer,
MeshProperties &&  properties 
)
explicit

Creates a new MemoryMesh from an existing vertex and index buffers.

Parameters
vertexBufferThe vertex buffer to create the mesh from.
indexBufferThe index buffer to create the mesh from.
propertiesThe mesh properties data.

◆ MemoryMesh() [3/8]

CeresEngine::MemoryMesh::MemoryMesh ( MemoryView< const Byte vertexBuffer,
MeshProperties &&  properties 
)
explicit

Creates a new MemoryMesh from an existing vertex buffer.

Parameters
vertexBufferThe vertex buffer to create the mesh from.
propertiesThe mesh properties data.

◆ MemoryMesh() [4/8]

CeresEngine::MemoryMesh::MemoryMesh ( MemoryView< const Byte vertexBuffer,
MemoryView< const Byte indexBuffer,
MeshProperties &&  properties 
)
explicit

Creates a new MemoryMesh from an existing vertex and index buffers.

Parameters
vertexBufferThe vertex buffer to create the mesh from.
indexBufferThe index buffer to create the mesh from.
propertiesThe mesh properties data.

◆ MemoryMesh() [5/8]

CeresEngine::MemoryMesh::MemoryMesh ( Vector< Byte vertexBuffer,
VertexDeclaration  vertexDeclaration,
Vector< SubMesh subMeshes 
)
inlineexplicit

Creates a new MemoryMesh from an existing vertex buffer.

Parameters
vertexBufferThe vertex buffer to create the mesh from.
vertexDeclarationThe format of the vertex buffer data.
subMeshesA vector of all sub-meshes contained in the buffer.

◆ MemoryMesh() [6/8]

CeresEngine::MemoryMesh::MemoryMesh ( Vector< Byte vertexBuffer,
VertexDeclaration  vertexDeclaration,
Vector< Byte indexBuffer,
const IndexType  indexType,
Vector< SubMesh subMeshes 
)
inlineexplicit

Creates a new MemoryMesh from an existing vertex and index buffers.

Parameters
vertexBufferThe vertex buffer to create the mesh from.
vertexDeclarationThe format of the vertex buffer data.
indexBufferThe index buffer to create the mesh from.
indexTypeThe data type used for vertex indices.
subMeshesA vector of all sub-meshes contained in the buffer.

◆ MemoryMesh() [7/8]

CeresEngine::MemoryMesh::MemoryMesh ( Vector< Byte vertexBuffer,
const VertexDeclaration vertexDeclaration,
Vector< Byte indexBuffer,
const Vector< SubMesh subMeshes 
)
inlineexplicit

Creates a new MemoryMesh from an existing vertex and index buffers.

Parameters
vertexBufferThe vertex buffer to create the mesh from.
vertexDeclarationThe format of the vertex buffer data.
indexBufferThe index buffer to create the mesh from.
indexTypeThe data type used for vertex indices.
subMeshesA vector of all sub-meshes contained in the buffer.

◆ MemoryMesh() [8/8]

CeresEngine::MemoryMesh::MemoryMesh ( )
explicitprivatedefault

Member Function Documentation

◆ getIndexBuffer()

MemoryView< const Byte > CeresEngine::MemoryMesh::getIndexBuffer ( ) const
inlinenoexcept

◆ getRawIndexBufferView()

ConstRawIndexBufferView CeresEngine::MemoryMesh::getRawIndexBufferView ( ) const
inlinefinalvirtual

Gets a raw view of the index buffer data.

Implements CeresEngine::Mesh.

◆ getRawVertexBufferView()

ConstRawVertexBufferView CeresEngine::MemoryMesh::getRawVertexBufferView ( ) const
inlinefinalvirtual

Gets a raw view of the vertex buffer data.

Implements CeresEngine::Mesh.

◆ getVertexBuffer()

MemoryView< const Byte > CeresEngine::MemoryMesh::getVertexBuffer ( ) const
inlinenoexcept

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::MemoryMesh::reflect ( Processor &&  RTTI)
inlinestaticconstexpr

Executes the given processor for every field of the struct.

Parameters
RTTIThe processor to be ran for every field.

Friends And Related Symbol Documentation

◆ TUserTypeInfo< MemoryMesh >

Member Data Documentation

◆ mIndexData

Vector<Byte> CeresEngine::MemoryMesh::mIndexData

A vector containing the index data.

◆ mVertexData

Vector<Byte> CeresEngine::MemoryMesh::mVertexData

A vector containing the vertex data.


The documentation for this class was generated from the following file: