CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Mesh Class Referenceabstract

A base class for all mesh implementations. More...

#include <CeresEngine/Mesh/Mesh.hpp>

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

Public Member Functions

 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.
 
virtual ConstRawVertexBufferView getRawVertexBufferView () const =0
 Gets a raw view of the vertex buffer data.
 
template<typename T >
VertexBufferView< const TgetVertexBufferView () const
 Gets a structured view of the vertex buffer data.
 
virtual ConstRawIndexBufferView getRawIndexBufferView () const =0
 Gets a raw view of the index 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::Resource
template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Public Attributes

MeshProperties mProperties
 A structure that contains a set of properties for the mesh.
 

Protected Member Functions

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.
 

Private Types

using super = TResource< Mesh >
 

Friends

class TUserTypeInfo< Mesh >
 

Detailed Description

A base class for all mesh implementations.

A polygon mesh is a collection of vertices, edges and faces that defines the shape of a polyhedral object. The faces usually consist of triangles (triangle mesh), quadrilaterals (quads), or other simple convex polygons (n-gons), since this simplifies rendering.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ Mesh() [1/2]

CeresEngine::Mesh::Mesh ( )
explicit

Creates a new empty mesh.

◆ Mesh() [2/2]

CeresEngine::Mesh::Mesh ( MeshProperties &&  properties)
explicit

Creates a new Mesh by constructing a new MeshProperties object.

◆ ~Mesh()

CeresEngine::Mesh::~Mesh ( )
override

Destroys the mesh object.

Member Function Documentation

◆ getBoundingBox()

const AABox & CeresEngine::Mesh::getBoundingBox ( ) const
inline

The mesh axis-aligned bounding box, can be used to perform culling.

◆ getBoundingSphere()

const Sphere & CeresEngine::Mesh::getBoundingSphere ( ) const
inline

The mesh bounding sphere, can be used to perform culling.

◆ getIndexBufferView()

template<typename T >
IndexBufferView< const T > CeresEngine::Mesh::getIndexBufferView ( ) const
inline

Gets a structured view of the index buffer data.

Template Parameters
TThe index data type.

◆ getIndexType()

const IndexType & CeresEngine::Mesh::getIndexType ( ) const
inline

The format used by the mesh index buffer, if an index buffer is available.

◆ getProperties()

const MeshProperties & CeresEngine::Mesh::getProperties ( ) const
inlinenoexcept

A structure that contains a set of properties for the mesh.

◆ getRawIndexBufferView()

virtual ConstRawIndexBufferView CeresEngine::Mesh::getRawIndexBufferView ( ) const
pure virtual

Gets a raw view of the index buffer data.

Implemented in CeresEngine::MemoryMesh, CeresEngine::StreamingMesh, and CeresEngine::GPUMesh.

◆ getRawVertexBufferView()

virtual ConstRawVertexBufferView CeresEngine::Mesh::getRawVertexBufferView ( ) const
pure virtual

Gets a raw view of the vertex buffer data.

Implemented in CeresEngine::MemoryMesh, CeresEngine::StreamingMesh, and CeresEngine::GPUMesh.

◆ getSubMeshes()

const Vector< SubMesh > & CeresEngine::Mesh::getSubMeshes ( ) const
inline

The sub meshes in the mesh.

◆ getVertexBufferView()

template<typename T >
VertexBufferView< const T > CeresEngine::Mesh::getVertexBufferView ( ) const
inline

Gets a structured view of the vertex buffer data.

Template Parameters
TThe vertex structure type.

◆ getVertexDeclaration()

const VertexDeclaration & CeresEngine::Mesh::getVertexDeclaration ( ) const
inline

The vertex declaration format used by the mesh.

◆ recalculateMeshBounds()

void CeresEngine::Mesh::recalculateMeshBounds ( )
protected

Recalculate the mesh bounds based on the sub-mesh bounds.

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::Mesh::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< Mesh >

Member Data Documentation

◆ mProperties

MeshProperties CeresEngine::Mesh::mProperties

A structure that contains a set of properties for the mesh.


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