RavEngine
Loading...
Searching...
No Matches
RavEngine::MeshAsset Class Reference
Inheritance diagram for RavEngine::MeshAsset:
[legend]
Collaboration diagram for RavEngine::MeshAsset:
[legend]

Classes

struct  Manager
 

Public Member Functions

 MeshAsset (const MeshAsset &)=delete
 
 MeshAsset (MeshAsset &&)=delete
 
auto GetAttributes () const
 
auto GetRadius () const
 
auto GetAllocation () const
 
 MeshAsset (const std::string &path, const MeshAssetOptions &options=MeshAssetOptions())
 
 MeshAsset (const Filesystem::Path &pathOnDisk, const MeshAssetOptions &options=MeshAssetOptions())
 
 MeshAsset (const RavEngine::Vector< MeshPart > &rawMeshData, const MeshAssetOptions &options=MeshAssetOptions())
 
 MeshAsset (const MeshPart &mesh, const MeshAssetOptions &options=MeshAssetOptions())
 
 MeshAsset (const MeshPartView &mesh, const MeshAssetOptions &options=MeshAssetOptions())
 
constexpr const decltype(bounds) & GetBounds () const
 
constexpr const decltype(totalVerts) GetNumVerts () const
 
constexpr const decltype(totalIndices) GetNumIndices () const
 
constexpr decltype(systemRAMcopy) & GetSystemCopy ()
 
bool hasSystemRAMCopy () const
 
void DeallocSystemCopy ()
 

Protected Member Functions

void InitializeFromMeshPartFragments (const RavEngine::Vector< MeshPart > &mp, const MeshAssetOptions &options=MeshAssetOptions())
 
void InitializeFromRawMesh (const MeshPart &mp, const MeshAssetOptions &options=MeshAssetOptions())
 
void InitializeFromRawMeshView (const MeshPartView &mp, const MeshAssetOptions &options=MeshAssetOptions())
 
MeshPart DeserializeMesh (const std::istream &stream)
 
std::pair< MeshPart, uint32_t > DeserializeMeshFromMemory (const std::span< uint8_t > mem)
 

Protected Attributes

size_t totalVerts = 0
 
size_t totalIndices = 0
 
Bounds bounds
 
float radius = 0
 
MeshAttributes attributes
 
MeshRange meshAllocation
 
MeshPart systemRAMcopy
 

Friends

class RenderEngine
 

Constructor & Destructor Documentation

◆ MeshAsset() [1/3]

RavEngine::MeshAsset::MeshAsset ( const std::string &  path,
const MeshAssetOptions &  options = MeshAssetOptions() 
)

Create a MeshAsset

Parameters
paththe path to the asset in the embedded filesystem
scalethe scale factor when loading
keepCopyInSystemMemorymaintain a copy of the mesh data in system RAM, for use in features that need it like mesh colliders

◆ MeshAsset() [2/3]

RavEngine::MeshAsset::MeshAsset ( const RavEngine::Vector< MeshPart > &  rawMeshData,
const MeshAssetOptions &  options = MeshAssetOptions() 
)
inline

Create a MeshAsset from multiple vertex and index lists

Parameters
rawMeshDatathe index and triangle data
keepCopyInSystemMemorymaintain a copy of the mesh data in system RAM, for use in features that need it like mesh colliders

◆ MeshAsset() [3/3]

RavEngine::MeshAsset::MeshAsset ( const MeshPart &  mesh,
const MeshAssetOptions &  options = MeshAssetOptions() 
)
inline

Create a MeshAsset from a single vertex and index list

Parameters
meshthe index and triangle data

Member Function Documentation

◆ DeallocSystemCopy()

void RavEngine::MeshAsset::DeallocSystemCopy ( )
inline

In case the system memory copy is no longer needed, destroy it. This is not undoable.

◆ InitializeFromMeshPartFragments()

void MeshAsset::InitializeFromMeshPartFragments ( const RavEngine::Vector< MeshPart > &  mp,
const MeshAssetOptions &  options = MeshAssetOptions() 
)
protected

Initialize from multiple meshs consisting of a single vertex and index list

Parameters
mpthe meshes to initialize from

◆ InitializeFromRawMesh()

void MeshAsset::InitializeFromRawMesh ( const MeshPart &  mp,
const MeshAssetOptions &  options = MeshAssetOptions() 
)
protected

Initialize from a complete mesh consisting of a single vertex and index list

Parameters
mpthe mesh to initialize from

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