载入中...
搜索中...
未找到
SceneNodeRef.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Identity.h"
6
7#include <string>
8#include <utility>
9#include <vector>
10
11namespace eve::scene {
12
13class Scene;
14
21public:
23 SceneNodeRef() = default;
25 SceneNodeRef(std::string hostName, std::string nodeId)
27 : hostName_(std::move(hostName)), nodeId_(std::move(nodeId)) {}
28
30 std::string getHostName() const { return hostName_; }
32 std::string getNodeId() const { return nodeId_; }
34 [[nodiscard]] bool isValid() const;
36 [[nodiscard]] eve::SceneObjectId persistentId() const;
45 Scene *getScene() const;
46
47 // --- local transform ---
49 bool setPosition(float x, float y, float z);
51 float getPositionX() const;
53 float getPositionY() const;
55 float getPositionZ() const;
57 std::vector<float> getPosition() const;
58
60 bool setRotation(float yaw, float pitch, float roll);
62 float getRotationYaw() const;
64 float getRotationPitch() const;
66 float getRotationRoll() const;
68 std::vector<float> getRotation() const;
69
71 bool setScale(float sx, float sy, float sz);
73 float getScaleX() const;
75 float getScaleY() const;
77 float getScaleZ() const;
79 std::vector<float> getScale() const;
80
82 bool setVisible(bool v);
84 bool isVisible() const;
85
86 // --- world (requires transforms updated via updateTransforms / scene.update) ---
88 float getWorldPositionX() const;
90 float getWorldPositionY() const;
92 float getWorldPositionZ() const;
94 std::vector<float> getWorldPosition() const;
96 std::vector<float> getWorldMatrix() const;
98 std::vector<float> getForward() const;
100 std::vector<float> getRight() const;
102 std::vector<float> getUp() const;
103
104 // --- structure ---
106 std::string getParentId() const;
108 int getChildCount() const;
110 std::string getChildIdAt(int ordinal) const;
112 std::string getPath() const;
113
114private:
115 std::string hostName_;
116 std::string nodeId_;
117};
118
119} // namespace eve::scene
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
std::string nodeId
#define EVENGINE_API_PLATFORM
Definition Export.h:107
float v
Strong identity values shared by persistence, content and logical-name APIs.
Id128 public API.
Definition Identity.h:112
Script handle to a scene node (hostName + nodeId). Deliberately holds strings rather than arena point...
SceneNodeRef(std::string hostName, std::string nodeId)
Scene node ref.
std::string getHostName() const
Returns the host name.
std::string getNodeId() const
Returns the node id.
SceneNodeRef()=default
Scene node ref.
Declarative scene module (eve.Scene).
Definition Scene.h:51