12#include <unordered_map>
16#include <glm/mat4x4.hpp>
55 std::vector<std::string>
tags;
62 float x = 0.f,
y = 0.f,
z = 0.f;
102 uint32_t ownerId = 0;
108 bool transformDirty =
true;
109 bool indexValid =
false;
125 COMPONENT(
Meta, meta)
126 COMPONENT(
Tree, tree)
137 void setName(
const std::string &
name);
138 const std::string &getName();
139 void setOwnerId(uint32_t ownerId) { meta()->ownerId = ownerId; }
167 int findIndexById(
const std::string &
id);
168 int findIndexByKey(
const std::string &
key);
169 int findIndexByName(
const std::string &
name);
170 int findIndexByPath(
const std::string &
path);
172 bool hasNode(
const std::string &
id);
180 [[nodiscard]]
SceneNode *getParentById(
const std::string &
id);
182 int getChildCountById(
const std::string &
id);
184 int getChildIndexAt(
int parentIndex,
int childOrdinal);
185 [[nodiscard]]
SceneNode *getChildAt(
int parentIndex,
int childOrdinal);
186 [[nodiscard]]
SceneNode *getChildAtById(
const std::string &
parentId,
int childOrdinal);
187 std::vector<int> getChildIndices(
int nodeIndex);
188 std::vector<SceneNode *> getChildren(
int nodeIndex);
189 std::vector<std::string> getChildIds(
const std::string &
parentId);
193 std::string getPathById(
const std::string &
id);
195 bool isAncestorOf(
int ancestorIndex,
int nodeIndex);
196 bool isAncestorOfById(
const std::string &ancestorId,
const std::string &
nodeId);
197 bool isDescendantOf(
int nodeIndex,
int ancestorIndex);
198 bool isDescendantOfById(
const std::string &
nodeId,
const std::string &ancestorId);
205 markSubtreeDirty(findIndexById(
nodeId));
211 const std::string &
nodeId,
215 void fireEvent(
const std::string &
action,
const std::string &
nodeId,
225 bool setParent(
int childIndex,
int parentIndex);
226 bool addChild(
int parentIndex,
int childIndex);
227 bool removeChild(
int parentIndex,
int childIndex);
243 SceneMutationStatus removeLeaf(
const std::string &
nodeId);
245 SceneMutationStatus renameNode(
const std::string &
nodeId,
const std::string &
name);
247 SceneMutationStatus setLocalTransform(
const std::string &
nodeId,
float x,
float y,
float z,
251 void forEachDepthFirst(
int nodeIndex,
void (*
fn)(SceneHost *,
int,
void *),
void *user);
272 std::vector<int> filterIndices(
NodePredFn pred);
275 std::vector<SceneNode *> findAllByName(
const std::string &
name);
276 std::vector<SceneNode *> findAllByKey(
const std::string &
key);
277 std::vector<SceneNode *> findAllVisible(
bool visible =
true);
278 std::vector<SceneNode *> findAllBySpace(
const std::string &space);
279 std::vector<SceneNode *> findAllLinked();
281 std::vector<std::string> collectIds();
282 std::vector<std::string> collectIdsFrom(
int nodeIndex);
283 std::vector<std::string> collectIdsWhere(
NodePredFn pred);
284 std::vector<std::string> collectIdsByName(
const std::string &
name);
285 std::vector<std::string> collectIdsVisible(
bool visible =
true);
295 bool link(
const std::string &
nodeId,
int kind,
void *
target,
int syncMode = 0);
305 bool unlink(
const std::string &
nodeId,
int kind);
307 bool unlink(
const std::string &
nodeId);
319 int linkCount(
const std::string &
nodeId);
322 bool setParentById(
const std::string &childId,
const std::string &
parentId);
323 bool removeChildById(
const std::string &
parentId,
const std::string &childId);
328 std::vector<SceneNode *> findAllByTag(
const std::string &
tag);
#define EVENGINE_API_PLATFORM
Strong identity values shared by persistence, content and logical-name APIs.
graphics::Canvas * previous
std::function< eve::Result< void >()> release
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
A playable audio source (static buffer or streaming decoder). Not thread-safe for playback control ex...
EVENGINE_API_BACKENDS public API.
Default renderable entity for declarative 2D sprites / solid quads.
EVENGINE_API_BACKENDS public API.
3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create pr...
2D rigid body (Box2D) in pixel-space coordinates. Owned by a World; create shapes with newRectangleFi...
ECS mount point for one scene graph (full scene or nested subtree root). Isomorphic to eve::ui::UIHos...
void setOwnerId(uint32_t ownerId)
std::function< void(SceneHost *host, const std::string &action, const std::string &nodeId, const std::string &parentId)> SceneEventFn
void setEventHandler(SceneEventFn fn)
std::function< bool(SceneHost *host, int index, const SceneNode &node)> NodePredFn
void markTransformDirty()
void markSubtreeDirtyById(const std::string &nodeId)
std::function< void(SceneHost *host, int index, SceneNode &node)> NodeVisitFn
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Optional physics backend for vehicle mobility and body attach.
SceneMutationStatus
Outcome of an atomic scene-tree mutation.
SettlementPipeline::Stage fn
Declarative scene-node description (build once / on dirty → flatten into SceneHost::Tree)....
std::vector< SceneNode > nodes
std::unordered_map< std::string, int > idIndex
Retained scene node (arena). Conceptual GameObject; isomorphic to eve::ui::UINode.
uint32_t objectId
Lazy companion SceneObject ECS runtime id; 0 = none. Never a persisted identity.
eve::SceneObjectId persistentId
Persisted object identity; nil means the legacy locator is still in use.
float bminX
Local-space AABB (for picking / culling / spatial index).
std::vector< std::string > tags
Gameplay groups (Godot-style): multiple string tags per node.
bool subtreeDirty
Subtree needs world recompute (API edits mark node + ancestors).
std::vector< SceneLink > links
Generic links (renderable / physics / camera / audio). Target owned elsewhere.