Per-node ECS identity (created lazily when a node needs script bindings or engine components). A node's stable string id (hostName + nodeId) is mirrored here so ECS systems can address scene nodes and vice versa. 更多...
#include <SceneObject.h>
类 | |
| struct | Meta |
| Meta public API. 更多... | |
| struct | ScriptBindings |
Public 成员函数 | |
| void | release () override |
| Entity. | |
静态 Public 成员函数 | |
| static eve::Result< SceneObject * > | createObject (const std::string &hostName, const std::string &nodeId, eve::SceneObjectId persistentId={}) |
| Creates an ECS-owned companion object with an explicit ownership contract. | |
详细描述
Per-node ECS identity (created lazily when a node needs script bindings or engine components). A node's stable string id (hostName + nodeId) is mirrored here so ECS systems can address scene nodes and vice versa.
Meta holds the binding back to the arena node; ScriptBindings roots the script eve.SceneEntity instances attached to that node (sq_addref). The scene module owns the whole lifecycle; do not create standalone.
在文件 SceneObject.h 第 25 行定义.
成员函数说明
◆ createObject()
|
static |
Creates an ECS-owned companion object with an explicit ownership contract.
- 参数
-
hostName Owning scene host name. nodeId Stable node locator within that host. persistentId Stable scene-object identity, if available.
- 返回
- Borrowed ECS object pointer, or a structured creation failure. @ownership The scene ECS table owns the object; callers must not delete it. @lifetime Valid until deferred ECS destruction or table teardown; use the entity handle across frames. @thread Call on the scene ECS thread. @reentrancy Creation does not invoke user callbacks; do not re-enter structural ECS mutation while using the result.
- 备注
- The scene/ECS table owns the object; the pointer becomes stale after destruction or a deferred table commit.
在文件 SceneObject.cpp 第 7 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), nodeId, eve::Status::success() , 以及 eve::Result< T >::success().
◆ release()
|
inlineoverride |
该类的文档由以下文件生成:
- src/modules/scene/SceneObject.h
- src/modules/scene/SceneObject.cpp