ezEngine Release 26.9
Loading...
Searching...
No Matches
ezMeshResourceDescriptor Class Reference

#include <MeshResourceDescriptor.h>

Classes

struct  BoneData
 Data for a bone used in skinned meshes. More...
 
struct  Material
 Material slot information. More...
 
struct  SubMesh
 

Public Member Functions

void Clear ()
 
ezMeshBufferResourceDescriptor & MeshBufferDesc ()
 
const ezMeshBufferResourceDescriptor & MeshBufferDesc () const
 
void UseExistingMeshBuffer (const ezMeshBufferResourceHandle &hBuffer)
 
void AddSubMesh (ezUInt32 uiPrimitiveCount, ezUInt32 uiFirstPrimitive, ezUInt32 uiMaterialIndex)
 Adds a sub-mesh to the descriptor.
 
void SetMaterial (ezUInt32 uiMaterialIndex, ezStringView sPathToMaterial)
 Sets the material path for a material slot.
 
void Save (ezStreamWriter &inout_stream)
 
ezResult Save (const char *szFile)
 
ezResult Load (ezStreamReader &inout_stream)
 
ezResult Load (const char *szFile)
 
const ezMeshBufferResourceHandle & GetExistingMeshBuffer () const
 
ezArrayPtr< const Material > GetMaterials () const
 
ezArrayPtr< const SubMesh > GetSubMeshes () const
 
void CollapseSubMeshes ()
 Merges all submeshes into just one.
 
void ComputeBounds ()
 
const ezBoundingBoxSphere & GetBounds () const
 
void SetBounds (const ezBoundingBoxSphere &bounds)
 

Public Attributes

ezSkeletonResourceHandle m_hDefaultSkeleton
 Default skeleton for skinned meshes.
 
ezHashTable< ezHashedString, BoneData > m_Bones
 Bone data indexed by bone name.
 
float m_fMaxBoneVertexOffset = 0.0f
 

Detailed Description

Descriptor for creating mesh resources.

Defines sub-meshes with materials, references or creates mesh buffer data, and stores bounding information. Used both for procedural mesh generation and loading from files.

Member Function Documentation

◆ Load()

ezResult ezMeshResourceDescriptor::Load ( ezStreamReader &  inout_stream)
Todo:
Material Path (relative to mesh file)
Todo:
load from file

◆ MeshBufferDesc()

ezMeshBufferResourceDescriptor & ezMeshResourceDescriptor::MeshBufferDesc ( )

Returns the mesh buffer descriptor for creating a new mesh buffer.

Use this when building mesh data procedurally. Mutually exclusive with UseExistingMeshBuffer.

◆ Save()

void ezMeshResourceDescriptor::Save ( ezStreamWriter &  inout_stream)
Todo:
Material Path (relative to mesh file)

◆ UseExistingMeshBuffer()

void ezMeshResourceDescriptor::UseExistingMeshBuffer ( const ezMeshBufferResourceHandle &  hBuffer)

Uses an existing mesh buffer instead of creating a new one.

Mutually exclusive with modifying MeshBufferDesc.

Member Data Documentation

◆ m_fMaxBoneVertexOffset

float ezMeshResourceDescriptor::m_fMaxBoneVertexOffset = 0.0f

Maximum distance between any vertex and its influencing bones.

Can be used for adjusting the bounding box of an animated pose.


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