Own renderer entities and their prepared prefab resources, without owning a Scene node. @ownership The ECS table owns entity storage; this adapter owns entity lifecycles and the preparation lease. @lifetime The ECS table, Graphics and resource factories must outlive this object. Unlink Scene links before release. @thread Graphics/ECS-owner thread only, outside view iteration for creation; no scripts, callbacks or locks. 更多...
#include <StaticPrefabRenderInstance.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| ~StaticPrefabRenderInstance () | |
| Destroy surviving renderer entities before releasing their material/mesh preparation lease. | |
| StaticPrefabRenderInstance (const StaticPrefabRenderInstance &)=delete | |
| StaticPrefabRenderInstance & | operator= (const StaticPrefabRenderInstance &)=delete |
| Result< void > | setWorldTransform (const std::array< float, 16 > &world) |
| Update all composed renderer matrices after validating every matrix and live entity handle. | |
| std::size_t | rendererCount () const noexcept |
| Return the number of owned renderer handles; externally deleted entries remain counted until release. | |
| Result< graphics::Renderable3D * > | renderer (std::size_t index) const |
| Resolve a renderer for synchronous Scene linking or diagnostics. | |
| Result< void > | release () |
| Destroy surviving entities, then release preparation; cleanup failure retains the lease for retry. | |
静态 Public 成员函数 | |
| static Result< std::unique_ptr< StaticPrefabRenderInstance > > | create (std::unique_ptr< PreparedStaticPrefabScene > preparation, const std::array< float, 16 > &world) |
| Consume preparation and publish all renderer parts after validating composed transforms. | |
详细描述
Own renderer entities and their prepared prefab resources, without owning a Scene node. @ownership The ECS table owns entity storage; this adapter owns entity lifecycles and the preparation lease. @lifetime The ECS table, Graphics and resource factories must outlive this object. Unlink Scene links before release. @thread Graphics/ECS-owner thread only, outside view iteration for creation; no scripts, callbacks or locks.
- 备注
- Runtime handles detect external entity deletion/reuse. Reimport creates a separate candidate before swap.
在文件 StaticPrefabRenderInstance.h 第 19 行定义.
构造及析构函数说明
◆ ~StaticPrefabRenderInstance()
| eve::asset_graphics::StaticPrefabRenderInstance::~StaticPrefabRenderInstance | ( | ) |
Destroy surviving renderer entities before releasing their material/mesh preparation lease.
在文件 StaticPrefabRenderInstance.cpp 第 35 行定义.
◆ StaticPrefabRenderInstance()
|
delete |
成员函数说明
◆ create()
|
static |
Consume preparation and publish all renderer parts after validating composed transforms.
- 参数
-
preparation Owning preparation consumed on success or failure; existing instances are untouched. world Finite column-major affine instance matrix, composed with each complete prefab-local matrix.
- 返回
- Owning renderer instance or structured validation/allocation failure with candidate entities removed. @cost Linear in renderer count, allocating ECS entities once per instance after explicit prefab preparation.
- 备注
- Rejects deferred ECS creation. No Scene mutation or automatic asset lookup occurs.
在文件 StaticPrefabRenderInstance.cpp 第 39 行定义.
引用了 entity, error, eve::Diagnostic::error(), eve::Failed, handle, eve::InvalidArgument , 以及 matrix.
被这些函数引用 eve::asset_graphics::ProcgenPrefabSceneSink::Impl::prepare().
◆ operator=()
|
delete |
◆ release()
| Result< void > eve::asset_graphics::StaticPrefabRenderInstance::release | ( | ) |
Destroy surviving entities, then release preparation; cleanup failure retains the lease for retry.
- 返回
- Success or backend cleanup error. Repeated successful release is harmless.
在文件 StaticPrefabRenderInstance.cpp 第 105 行定义.
引用了 entity, handle, result , 以及 eve::Result< T >::success().
被这些函数引用 ~StaticPrefabRenderInstance().
◆ renderer()
| Result< graphics::Renderable3D * > eve::asset_graphics::StaticPrefabRenderInstance::renderer | ( | std::size_t | index | ) | const |
Resolve a renderer for synchronous Scene linking or diagnostics.
- 返回
- Borrowed renderer or NotFound/StaleHandle; never transfers entity ownership. @ownership ECS owns storage. @lifetime Valid until entity deletion, table mutation or instance release.
- 备注
- Do not retain the pointer across frames; Scene links must be removed before adapter release.
在文件 StaticPrefabRenderInstance.cpp 第 74 行定义.
引用了 entity, eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::NotFound, eve::StaleHandle , 以及 eve::Result< T >::success().
被这些函数引用 eve::asset_graphics::ProcgenPrefabSceneSink::Impl::visibility().
◆ rendererCount()
|
noexcept |
Return the number of owned renderer handles; externally deleted entries remain counted until release.
在文件 StaticPrefabRenderInstance.cpp 第 73 行定义.
被这些函数引用 eve::asset_graphics::ProcgenPrefabSceneSink::Impl::visibility().
◆ setWorldTransform()
| Result< void > eve::asset_graphics::StaticPrefabRenderInstance::setWorldTransform | ( | const std::array< float, 16 > & | world | ) |
Update all composed renderer matrices after validating every matrix and live entity handle.
- 返回
- Success, invalid matrix, released state or StaleHandle; failures leave surviving renderer poses unchanged. @cost Linear in prepared renderer count; no allocations, asset resolution or GPU upload.
在文件 StaticPrefabRenderInstance.cpp 第 84 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, matrix, parts, eve::PreconditionViolation, renderer, eve::Result< T >::success() , 以及 target.
该类的文档由以下文件生成:
- src/modules/asset/graphics/StaticPrefabRenderInstance.h
- src/modules/asset/graphics/StaticPrefabRenderInstance.cpp