载入中...
搜索中...
未找到
SceneObject.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/ECS.h"
6#include "common/Identity.h"
7#include "common/Result.h"
8
9#include <squirrel.h>
10
11#include <string>
12#include <vector>
13
14namespace eve::scene {
15
25class EVENGINE_API_PLATFORM SceneObject : public ecs::Entity {
26public:
28 ENTITY(SceneObject, ecs::Entity)
29
30
31 void release() override { ecs::DestroyEntity(this); }
32
34 struct Meta {
35 SceneObject *entity = nullptr;
36 std::string hostName;
37 std::string nodeId;
40 };
41
43 std::vector<HSQOBJECT> instances; // rooted script entity instances
44 };
45
46 COMPONENT(Meta, meta)
47 COMPONENT(ScriptBindings, scriptBindings)
48
49
63 [[nodiscard]] static eve::Result<SceneObject *> createObject(const std::string &hostName, const std::string &nodeId,
64 eve::SceneObjectId persistentId = {});
65};
66
67} // namespace eve::scene
std::string nodeId
#define EVENGINE_API_PLATFORM
Definition Export.h:107
Strong identity values shared by persistence, content and logical-name APIs.
std::function< eve::Result< void >()> release
Definition Procgen.cpp:86
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Id128 public API.
Definition Identity.h:112
Per-node ECS identity (created lazily when a node needs script bindings or engine components)....
Definition SceneObject.h:25
eve::SceneObjectId persistentId
Stable scene-object identity copied from the owning SceneNode.
Definition SceneObject.h:39
std::vector< HSQOBJECT > instances
Definition SceneObject.h:43