/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/RendererCore/Meshes/MeshResource.h
57 строк
2 KB
C-Core
Spline Meshes (#1771)
13 янв 2026, 12:01
Не верифицирован
13 янв 2026, 12:01
d6b93e7
Код
Авторство
О чём код?
#pragma once #include <RendererCore/Meshes/MeshBufferResource.h> #include <RendererCore/Meshes/MeshResourceDescriptor.h> using ezMaterialResourceHandle = ezTypedResourceHandle<class ezMaterialResource>; /// Resource representing a renderable mesh. /// /// Contains sub-meshes with materials, references a mesh buffer for vertex/index data, /// and stores bounding information. For skinned meshes, also includes skeleton and bone data. class EZ_RENDERERCORE_DLL ezMeshResource : public ezResource { EZ_ADD_DYNAMIC_REFLECTION(ezMeshResource, ezResource); EZ_RESOURCE_DECLARE_COMMON_CODE(ezMeshResource); EZ_RESOURCE_DECLARE_CREATEABLE(ezMeshResource, ezMeshResourceDescriptor); public: ezMeshResource(); /// \brief Returns the array of sub-meshes in this mesh. ezArrayPtr<const ezMeshResourceDescriptor::SubMesh> GetSubMeshes() const { return m_SubMeshes; } /// \brief Returns the mesh buffer that is used by this resource. const ezMeshBufferResourceHandle& GetMeshBuffer() const { return m_hMeshBuffer; } /// \brief Returns the default materials for this mesh. ezArrayPtr<const ezMaterialResourceHandle> GetMaterials() const { return m_Materials; } /// \brief Returns the bounds of this mesh. const ezBoundingBoxSphere& GetBounds() const { return m_Bounds; } /// \brief Returns the asset hash for this mesh. Returns 0 if the mesh was not loaded from an asset file. ezUInt64 GetAssetHash() const { return m_uiAssetHash; } // TODO: clean up ezSkeletonResourceHandle m_hDefaultSkeleton; ezHashTable<ezHashedString, ezMeshResourceDescriptor::BoneData> m_Bones; float m_fMaxBoneVertexOffset = 0.0f; // the maximum distance between any vertex and its influencing bones, can be used for adjusting the bounding box of a pose private: virtual ezResourceLoadDesc UnloadData(Unload WhatToUnload) override; virtual ezResourceLoadDesc UpdateContent(ezStreamReader* Stream) override; virtual void UpdateMemoryUsage(MemoryUsage& out_NewMemoryUsage) override; ezBoundingBoxSphere m_Bounds; ezDynamicArray<ezMeshResourceDescriptor::SubMesh> m_SubMeshes; ezMeshBufferResourceHandle m_hMeshBuffer; ezDynamicArray<ezMaterialResourceHandle> m_Materials; ezUInt64 m_uiAssetHash = 0; static ezUInt32 s_uiMeshBufferNameSuffix; }; using ezMeshResourceHandle = ezTypedResourceHandle<class ezMeshResource>;