载入中...
搜索中...
未找到
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
34 virtual ~ISceneQuery() = default;
35
37 virtual std::string activeHost() const = 0;
39 virtual int hostCount() const = 0;
41 virtual std::string hostNameAt(int index) const = 0;
42
44 virtual int nodeCount() const = 0;
46 virtual std::string rootId() const = 0;
48 virtual std::vector<SceneNodeInfo> nodes(int limit) const = 0;
50 virtual std::vector<SceneNodeInfo> nodesOf(const std::string& host, int limit) const = 0;
52 virtual bool getNode(const std::string& id, SceneNodeInfo* out) const = 0;
54 virtual bool getNodeIn(const std::string& host, const std::string& id,
55 SceneNodeInfo* out) const = 0;
56
58 virtual bool setNodeTransform(const std::string& id, float x, float y, float z) = 0;
60 virtual bool setNodeVisible(const std::string& id, bool visible) = 0;
62 virtual void syncTransforms() = 0;
63};
64
65} // namespace eve
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
int y
Definition Grass.cpp:135
int z
Definition Grass.cpp:135
int x
Definition Grass.cpp:135
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
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).
Definition Build.cpp:11
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