载入中...
搜索中...
未找到
SceneQuery.h
浏览该文件的文档.
1#pragma once
2
3// Capability interface: scene inspection for devtools / MCP.
4//
5// Scene is an optional module. DevTools must not include scene headers, so the
6// scene module registers an implementation of this interface and devtools
7// queries it (nullptr when the module was trimmed out).
8
9#include "common/Export.h"
10
11#include <string>
12#include <vector>
13
14namespace eve {
15
18 std::string id;
19 std::string name;
20 std::string path;
21 bool visible = true;
22 float x = 0.f, y = 0.f, z = 0.f;
23 float yaw = 0.f, pitch = 0.f, roll = 0.f;
24 float sx = 1.f, sy = 1.f, sz = 1.f;
25 std::string parent;
26 std::vector<std::string> children;
27};
28
31public:
32 static constexpr const char* capabilityName = "ISceneQuery";
33
35 virtual ~ISceneQuery() = default;
36
38 virtual std::string activeHost() const = 0;
40 virtual int hostCount() const = 0;
42 virtual std::string hostNameAt(int index) const = 0;
43
45 virtual int nodeCount() const = 0;
47 virtual std::string rootId() const = 0;
49 virtual std::vector<SceneNodeInfo> nodes(int limit) const = 0;
51 virtual std::vector<SceneNodeInfo> nodesOf(const std::string& host, int limit) const = 0;
53 virtual bool getNode(const std::string& id, SceneNodeInfo* out) const = 0;
55 virtual bool getNodeIn(const std::string& host, const std::string& id,
56 SceneNodeInfo* out) const = 0;
57
59 virtual bool setNodeTransform(const std::string& id, float x, float y, float z) = 0;
61 virtual bool setNodeVisible(const std::string& id, bool visible) = 0;
63 virtual void syncTransforms() = 0;
64};
65
66} // namespace eve
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
bool visible
int limit
Definition TreeMesh.cpp:164
UIHostHandle host
uint32_t index
Scene graph query/mutation surface (provided by the scene module).
Definition SceneQuery.h:30
virtual bool getNodeIn(const std::string &host, const std::string &id, SceneNodeInfo *out) const =0
Look up one node in a named host.
virtual ~ISceneQuery()=default
I scene query.
virtual void syncTransforms()=0
Propagate local transforms -> world for every host.
virtual std::string hostNameAt(int index) const =0
Name of the host at index.
virtual std::string activeHost() const =0
Name of the currently selected host, or "" when none.
virtual int hostCount() const =0
Number of mounted hosts.
virtual bool setNodeTransform(const std::string &id, float x, float y, float z)=0
Mutate the active host's node transform (marks subtree dirty).
virtual bool getNode(const std::string &id, SceneNodeInfo *out) const =0
Look up one node in the active host.
virtual std::vector< SceneNodeInfo > nodes(int limit) const =0
Depth-first node list of the active host, capped at limit.
virtual bool setNodeVisible(const std::string &id, bool visible)=0
Show/hide a node in the active host.
virtual std::string rootId() const =0
Root node id of the active host, or "".
virtual std::vector< SceneNodeInfo > nodesOf(const std::string &host, int limit) const =0
Node list of a named host, capped at limit.
virtual int nodeCount() const =0
Node count of the active host (0 when none).
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
Serializable snapshot of one scene node (value type, no scene types).
Definition SceneQuery.h:17
std::vector< std::string > children
Definition SceneQuery.h:26
std::string path
Definition SceneQuery.h:20
std::string parent
Definition SceneQuery.h:25
std::string id
Definition SceneQuery.h:18
std::string name
Definition SceneQuery.h:19