/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/RendererCore/Rasterizer/RasterizerObject.h
50 строк
2 KB
Jan Krassnigg
Fixes for including public ez headers (#1755)
04 янв 2026, 10:57
Не верифицирован
04 янв 2026, 10:57
5feb7ef
Код
Авторство
О чём код?
#pragma once #include <Foundation/Containers/Map.h> #include <Foundation/Math/Mat4.h> #include <Foundation/Strings/String.h> #include <Foundation/Threading/Mutex.h> #include <Foundation/Types/RefCounted.h> #include <Foundation/Types/SharedPtr.h> #include <RendererCore/Rasterizer/Thirdparty/Occluder.h> #include <RendererCore/RendererCoreDLL.h> class ezGeometry; /// Represents a mesh for CPU-based software rasterization and occlusion culling. /// /// Used for occlusion testing in ezRasterizerView. Objects are cached by name and shared across users. /// Internally uses a software rasterizer to determine if objects are occluded by other geometry. class EZ_RENDERERCORE_DLL ezRasterizerObject : public ezRefCounted { EZ_DISALLOW_COPY_AND_ASSIGN(ezRasterizerObject); public: ezRasterizerObject(); ~ezRasterizerObject(); /// \brief If an object with the given name has been created before, it is returned, otherwise nullptr is returned. /// /// Use this to quickly query for an existing object. Call CreateMesh() in case the object doesn't exist yet. static ezSharedPtr<const ezRasterizerObject> GetObject(ezStringView sUniqueName); /// \brief Creates a box object with the specified dimensions. If such a box was created before, the same pointer is returned. static ezSharedPtr<const ezRasterizerObject> CreateBox(const ezVec3& vFullExtents); /// \brief Creates a quad pointing into the positive X direction with the dimensions along Y and Z. If such a quad was created before, the same pointer is returned. static ezSharedPtr<const ezRasterizerObject> CreateQuadX(const ezVec2& vYZExtents); /// \brief Creates an object with the given geometry. If an object with the same name was created before, that pointer is returned instead. /// /// It is assumed that the same name will only be used for identical geometry. static ezSharedPtr<const ezRasterizerObject> CreateMesh(ezStringView sUniqueName, const ezGeometry& geometry); private: void CreateMesh(const ezGeometry& geometry); friend class ezRasterizerView; Occluder m_Occluder; static ezMutex s_Mutex; static ezMap<ezString, ezSharedPtr<ezRasterizerObject>> s_Objects; };