载入中...
搜索中...
未找到

ECS mount point for one scene graph (full scene or nested subtree root). Isomorphic to eve::ui::UIHost. 更多...

#include <SceneHost.h>

类 eve::scene::SceneHost 继承关系图:

类

struct  Meta
 Meta public API. 更多...
 
struct  Tree
 

Public 类型

using SceneEventFn = std::function< void(SceneHost *host, const std::string &action, const std::string &nodeId, const std::string &parentId)>
 
using NodeVisitFn = std::function< void(SceneHost *host, int index, SceneNode &node)>
 
using NodePredFn = std::function< bool(SceneHost *host, int index, const SceneNode &node)>
 

Public 成员函数

void release () override
 Entity.
 
void setName (const std::string &name)
 
const std::string & getName ()
 
void setOwnerId (uint32_t ownerId)
 
uint32_t getOwnerId ()
 
void setTree (NodeDesc root)
 Full replace.
 
bool setTreeReconcile (NodeDesc root)
 Key-aware patch when structure matches; else full replace.
 
eve::Result< SceneNode * > findById (const std::string &id)
 Finds a node by stable id with an explicit status.
 
eve::Result< SceneNode * > findByKey (const std::string &key)
 Finds a node by reconcile key with an explicit status.
 
eve::Result< SceneNode * > findByName (const std::string &name)
 Finds the first node name match with an explicit status.
 
eve::Result< SceneNode * > findByPath (const std::string &path)
 Finds a node path with an explicit status.
 
int findIndexById (const std::string &id)
 
int findIndexByKey (const std::string &key)
 
int findIndexByName (const std::string &name)
 
int findIndexByPath (const std::string &path)
 
bool hasNode (const std::string &id)
 
int getNodeCount ()
 
int getRootIndex ()
 
SceneNode * getRoot ()
 
SceneNode * getNode (int index)
 
int getParentIndex (int nodeIndex)
 
SceneNode * getParent (int nodeIndex)
 
SceneNode * getParentById (const std::string &id)
 
int getChildCount (int nodeIndex)
 
int getChildCountById (const std::string &id)
 
int getChildIndexAt (int parentIndex, int childOrdinal)
 Child ordinal 0..count-1; -1 if out of range.
 
SceneNode * getChildAt (int parentIndex, int childOrdinal)
 
SceneNode * getChildAtById (const std::string &parentId, int childOrdinal)
 
std::vector< int > getChildIndices (int nodeIndex)
 
std::vector< SceneNode * > getChildren (int nodeIndex)
 
std::vector< std::string > getChildIds (const std::string &parentId)
 
std::string getPath (int nodeIndex)
 Id path "a/b/c" from root to node; empty if invalid.
 
std::string getPathById (const std::string &id)
 
bool isAncestorOf (int ancestorIndex, int nodeIndex)
 
bool isAncestorOfById (const std::string &ancestorId, const std::string &nodeId)
 
bool isDescendantOf (int nodeIndex, int ancestorIndex)
 
bool isDescendantOfById (const std::string &nodeId, const std::string &ancestorId)
 
void markDirty ()
 
void markTransformDirty ()
 
void markSubtreeDirty (int nodeIndex)
 Mark a node's subtree for world recompute (recompute it + descendants).
 
void markSubtreeDirtyById (const std::string &nodeId)
 
void invalidateIndex ()
 
void setEventHandler (SceneEventFn fn)
 
void fireEvent (const std::string &action, const std::string &nodeId, const std::string &parentId={})
 Fire "node_added" / "node_removed" / "node_moved" / "node_changed".
 
void setVisible (bool v)
 
void setLayer (int layer)
 
bool setParent (int childIndex, int parentIndex)
 Imperative parent link. Returns false on invalid indices or cycle. Prefer declarative NodeDesc + reconcile for normal use.
 
bool addChild (int parentIndex, int childIndex)
 
bool removeChild (int parentIndex, int childIndex)
 
SceneMutationStatus appendNode (SceneNode node, const std::string &parentId={})
 Append one retained node without rebuilding existing nodes or links.
 
SceneMutationStatus removeLeaf (const std::string &nodeId)
 Remove a leaf node while preserving every other node and external link.
 
SceneMutationStatus renameNode (const std::string &nodeId, const std::string &name)
 Rename a retained node and emit a node_changed event.
 
SceneMutationStatus setLocalTransform (const std::string &nodeId, float x, float y, float z, float yaw, float pitch, float roll, float sx, float sy, float sz)
 Replace a node's local TRS and mark its subtree dirty.
 
void forEachDepthFirst (int nodeIndex, void(*fn)(SceneHost *, int, void *), void *user)
 Depth-first visit of arena indices under nodeIndex (inclusive). C callback.
 
void walkDepthFirst (NodeVisitFn fn)
 DFS from root (or from nodeIndex), inclusive.
 
void walkDepthFirstFrom (int nodeIndex, NodeVisitFn fn)
 
void walkBreadthFirst (NodeVisitFn fn)
 BFS from root (or from nodeIndex), inclusive.
 
void walkBreadthFirstFrom (int nodeIndex, NodeVisitFn fn)
 
void walkChildren (int parentIndex, NodeVisitFn fn)
 Direct children only.
 
void walkAncestors (int nodeIndex, NodeVisitFn fn)
 Parent chain upward, excluding self.
 
SceneNode * findIf (NodePredFn pred)
 First DFS match; nullptr if none.
 
SceneNode * findIfFrom (int nodeIndex, NodePredFn pred)
 
std::vector< SceneNode * > filter (NodePredFn pred)
 
std::vector< SceneNode * > filterFrom (int nodeIndex, NodePredFn pred)
 
std::vector< int > filterIndices (NodePredFn pred)
 
std::vector< int > filterIndicesFrom (int nodeIndex, NodePredFn pred)
 
std::vector< SceneNode * > findAllByName (const std::string &name)
 
std::vector< SceneNode * > findAllByKey (const std::string &key)
 
std::vector< SceneNode * > findAllVisible (bool visible=true)
 
std::vector< SceneNode * > findAllBySpace (const std::string &space)
 
std::vector< SceneNode * > findAllLinked ()
 
std::vector< std::string > collectIds ()
 
std::vector< std::string > collectIdsFrom (int nodeIndex)
 
std::vector< std::string > collectIdsWhere (NodePredFn pred)
 
std::vector< std::string > collectIdsByName (const std::string &name)
 
std::vector< std::string > collectIdsVisible (bool visible=true)
 
bool link (const std::string &nodeId, int kind, void *target, int syncMode=0)
 Attach an external object to a node id. Survives reconcile/rebuild by id. After TransformSystem the link is synced per kind (and syncMode).
 
bool linkRenderable2D (const std::string &nodeId, graphics::Renderable2D *r)
 
bool linkRenderable3D (const std::string &nodeId, graphics::Renderable3D *r)
 
bool linkPhysics2D (const std::string &nodeId, physics::Body *b, int syncMode=0)
 
bool linkPhysics3D (const std::string &nodeId, physics::Body3D *b, int syncMode=0)
 
bool linkCamera3D (const std::string &nodeId, graphics::Camera3D *c)
 
bool linkAudio3D (const std::string &nodeId, audio::Source *s)
 
bool unlink (const std::string &nodeId, int kind)
 Remove all links of a kind; returns true if a link was removed.
 
bool unlink (const std::string &nodeId)
 Remove every link on the node.
 
SceneLink * findLink (SceneNode *node, int kind)
 
const SceneLink * findLink (const SceneNode *node, int kind) const
 Find a link on a node without transferring ownership.
 
int linkCount (const std::string &nodeId)
 
bool setParentById (const std::string &childId, const std::string &parentId)
 Reparent by id; empty parentId detaches (parent = -1). Cycle-safe.
 
bool removeChildById (const std::string &parentId, const std::string &childId)
 
bool addTag (SceneNode *node, const std::string &tag)
 
bool removeTag (SceneNode *node, const std::string &tag)
 
bool hasTag (const SceneNode *node, const std::string &tag) const
 
std::vector< SceneNode * > findAllByTag (const std::string &tag)
 

静态 Public 成员函数

static eve::Result< Tree > buildDetachedTree (const Tree *previous, NodeDesc root)
 Builds a detached replacement tree without mutating a host or firing callbacks.
 
static eve::Result< SceneHost * > createHost (const std::string &name="")
 Creates an ECS-owned scene host with an explicit Result contract.
 

详细描述

ECS mount point for one scene graph (full scene or nested subtree root). Isomorphic to eve::ui::UIHost.

在文件 SceneHost.h 第 89 行定义.

成员类型定义说明

◆ NodePredFn

using eve::scene::SceneHost::NodePredFn = std::function<bool(SceneHost *host, int index, const SceneNode &node)>

在文件 SceneHost.h 第 254 行定义.

◆ NodeVisitFn

using eve::scene::SceneHost::NodeVisitFn = std::function<void(SceneHost *host, int index, SceneNode &node)>

在文件 SceneHost.h 第 253 行定义.

◆ SceneEventFn

using eve::scene::SceneHost::SceneEventFn = std::function<void(SceneHost *host, const std::string &action, const std::string &nodeId, const std::string &parentId)>

在文件 SceneHost.h 第 210 行定义.

成员函数说明

◆ addChild()

bool eve::scene::SceneHost::addChild ( int  parentIndex,
int  childIndex 
)

在文件 SceneHost.cpp 第 481 行定义.

引用了 setParent().

◆ addTag()

bool eve::scene::SceneHost::addTag ( SceneNode *  node,
const std::string &  tag 
)

在文件 SceneHost.cpp 第 711 行定义.

引用了 node, t , 以及 tag.

◆ appendNode()

SceneMutationStatus eve::scene::SceneHost::appendNode ( SceneNode  node,
const std::string &  parentId = {} 
)

Append one retained node without rebuilding existing nodes or links.

参数
nodeNode value with a unique non-empty id; hierarchy indices are ignored.
parentIdExisting parent id, or empty to append a detached root-level node.
返回
True when the node was appended and linked successfully.
备注
Appending may reallocate the node arena and invalidates borrowed SceneNode pointers.

在文件 SceneHost.cpp 第 151 行定义.

引用了 eve::scene::Applied, findIndexById(), fireEvent(), hasNode(), index, node, parentId, eve::scene::Rejected , 以及 value.

◆ buildDetachedTree()

eve::Result< SceneHost::Tree > eve::scene::SceneHost::buildDetachedTree ( const Tree *  previous,
NodeDesc  root 
)
static

Builds a detached replacement tree without mutating a host or firing callbacks.

参数
previousOptional previous tree whose links and lazy object ids are preserved by node id.
rootDeclarative target root.
返回
Fully indexed replacement tree, or a validation failure.

在文件 NodeDesc.cpp 第 296 行定义.

引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), found, node, previous, root, eve::scene::SceneHost::Tree::root, eve::Result< T >::success(), target , 以及 eve::scene::validateUniqueIds().

◆ collectIds()

std::vector< std::string > eve::scene::SceneHost::collectIds ( )

在文件 SceneHost.cpp 第 600 行定义.

引用了 collectIdsFrom() , 以及 root.

被这些函数引用 eve::scene::Scene::collectIds().

◆ collectIdsByName()

std::vector< std::string > eve::scene::SceneHost::collectIdsByName ( const std::string &  name)

在文件 SceneHost.cpp 第 616 行定义.

引用了 collectIdsWhere(), n , 以及 name.

被这些函数引用 eve::scene::Scene::collectIdsByName().

◆ collectIdsFrom()

std::vector< std::string > eve::scene::SceneHost::collectIdsFrom ( int  nodeIndex)

在文件 SceneHost.cpp 第 602 行定义.

引用了 n, nodeIndex , 以及 walkDepthFirstFrom().

被这些函数引用 collectIds() , 以及 eve::scene::Scene::collectIdsFrom().

◆ collectIdsVisible()

std::vector< std::string > eve::scene::SceneHost::collectIdsVisible ( bool  visible = true)

在文件 SceneHost.cpp 第 620 行定义.

引用了 collectIdsWhere(), n , 以及 visible.

被这些函数引用 eve::scene::Scene::collectIdsVisible().

◆ collectIdsWhere()

std::vector< std::string > eve::scene::SceneHost::collectIdsWhere ( NodePredFn  pred)

在文件 SceneHost.cpp 第 608 行定义.

引用了 filter , 以及 n.

被这些函数引用 collectIdsByName() , 以及 collectIdsVisible().

◆ createHost()

eve::Result< SceneHost * > eve::scene::SceneHost::createHost ( const std::string &  name = "")
static

Creates an ECS-owned scene host with an explicit Result contract.

参数
nameStable host name; empty names receive a process-local name.
返回
Borrowed host pointer, or a structured allocation/ownership failure.
备注
The ECS table owns the host. The pointer becomes stale after entity destruction; retain a runtime handle across deferred work.

在文件 SceneHost.cpp 第 129 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), h, name, eve::Status::success() , 以及 eve::Result< T >::success().

被这些函数引用 eve::sceneloader::SceneLoader::load() , 以及 eve::scene::SceneComponent::mountAs().

◆ filter()

std::vector< SceneNode * > eve::scene::SceneHost::filter ( NodePredFn  pred)

在文件 SceneHost.cpp 第 552 行定义.

引用了 filterFrom() , 以及 root.

◆ filterFrom()

std::vector< SceneNode * > eve::scene::SceneHost::filterFrom ( int  nodeIndex,
NodePredFn  pred 
)

在文件 SceneHost.cpp 第 556 行定义.

引用了 host, index, node, nodeIndex , 以及 walkDepthFirstFrom().

被这些函数引用 filter().

◆ filterIndices()

std::vector< int > eve::scene::SceneHost::filterIndices ( NodePredFn  pred)

在文件 SceneHost.cpp 第 565 行定义.

引用了 filterIndicesFrom() , 以及 root.

◆ filterIndicesFrom()

std::vector< int > eve::scene::SceneHost::filterIndicesFrom ( int  nodeIndex,
NodePredFn  pred 
)

在文件 SceneHost.cpp 第 569 行定义.

引用了 host, index, node, nodeIndex , 以及 walkDepthFirstFrom().

被这些函数引用 filterIndices().

◆ findAllByKey()

std::vector< SceneNode * > eve::scene::SceneHost::findAllByKey ( const std::string &  key)

在文件 SceneHost.cpp 第 582 行定义.

引用了 filter, key , 以及 n.

◆ findAllByName()

std::vector< SceneNode * > eve::scene::SceneHost::findAllByName ( const std::string &  name)

在文件 SceneHost.cpp 第 578 行定义.

引用了 filter, n , 以及 name.

◆ findAllBySpace()

std::vector< SceneNode * > eve::scene::SceneHost::findAllBySpace ( const std::string &  space)

在文件 SceneHost.cpp 第 590 行定义.

引用了 filter , 以及 n.

◆ findAllByTag()

std::vector< SceneNode * > eve::scene::SceneHost::findAllByTag ( const std::string &  tag)

在文件 SceneHost.cpp 第 739 行定义.

引用了 filter, n, t , 以及 tag.

◆ findAllLinked()

std::vector< SceneNode * > eve::scene::SceneHost::findAllLinked ( )

在文件 SceneHost.cpp 第 594 行定义.

引用了 filter , 以及 n.

◆ findAllVisible()

std::vector< SceneNode * > eve::scene::SceneHost::findAllVisible ( bool  visible = true)

在文件 SceneHost.cpp 第 586 行定义.

引用了 filter, n , 以及 visible.

◆ findById()

eve::Result< SceneNode * > eve::scene::SceneHost::findById ( const std::string &  id)

Finds a node by stable id with an explicit status.

返回
Borrowed node, invalidated by the next tree replacement/reconcile, or a failure.

在文件 SceneHost.cpp 第 227 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, n, eve::NotFound, eve::Status::success(), eve::Result< T >::success() , 以及 t.

被这些函数引用 link(), linkCount(), unlink() , 以及 unlink().

◆ findByKey()

eve::Result< SceneNode * > eve::scene::SceneHost::findByKey ( const std::string &  key)

Finds a node by reconcile key with an explicit status.

返回
Borrowed node, invalidated by the next tree replacement/reconcile, or a failure.

在文件 SceneHost.cpp 第 239 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, key, n, eve::NotFound, eve::Status::success(), eve::Result< T >::success() , 以及 t.

◆ findByName()

eve::Result< SceneNode * > eve::scene::SceneHost::findByName ( const std::string &  name)

Finds the first node name match with an explicit status.

返回
Borrowed node, invalidated by the next tree replacement/reconcile, or a failure.

在文件 SceneHost.cpp 第 251 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), findIndexByName(), idx, eve::InvalidArgument, name, nodes, eve::NotFound, eve::Status::success() , 以及 eve::Result< T >::success().

◆ findByPath()

eve::Result< SceneNode * > eve::scene::SceneHost::findByPath ( const std::string &  path)

Finds a node path with an explicit status.

返回
Borrowed node, invalidated by the next tree replacement/reconcile, or a failure.

在文件 SceneHost.cpp 第 262 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), findIndexByPath(), idx, eve::InvalidArgument, nodes, eve::NotFound, path, eve::Status::success() , 以及 eve::Result< T >::success().

◆ findIf()

SceneNode * eve::scene::SceneHost::findIf ( NodePredFn  pred)

First DFS match; nullptr if none.

在文件 SceneHost.cpp 第 540 行定义.

引用了 findIfFrom() , 以及 root.

◆ findIfFrom()

SceneNode * eve::scene::SceneHost::findIfFrom ( int  nodeIndex,
NodePredFn  pred 
)

在文件 SceneHost.cpp 第 542 行定义.

引用了 found, host, index, node, nodeIndex , 以及 walkDepthFirstFrom().

被这些函数引用 findIf().

◆ findIndexById()

int eve::scene::SceneHost::findIndexById ( const std::string &  id)

◆ findIndexByKey()

int eve::scene::SceneHost::findIndexByKey ( const std::string &  key)

在文件 SceneHost.cpp 第 288 行定义.

引用了 key , 以及 t.

◆ findIndexByName()

int eve::scene::SceneHost::findIndexByName ( const std::string &  name)

在文件 SceneHost.cpp 第 297 行定义.

引用了 found, index, n, name , 以及 walkDepthFirst().

被这些函数引用 findByName().

◆ findIndexByPath()

int eve::scene::SceneHost::findIndexByPath ( const std::string &  path)

在文件 SceneHost.cpp 第 307 行定义.

引用了 idx, n, p, parts, path, start , 以及 t.

被这些函数引用 findByPath().

◆ findLink() [1/2]

const SceneLink * eve::scene::SceneHost::findLink ( const SceneNode *  node,
int  kind 
) const

Find a link on a node without transferring ownership.

返回
Borrowed nullable link owned by the node's host. @ownership SceneHost owns link records; callers must not delete or mutate the result. @lifetime Valid until link mutation, tree replacement, or host destruction. @thread Call on the scene thread owning this host. @reentrancy Do not retain across link callbacks or host mutation.

在文件 SceneHost.cpp 第 683 行定义.

引用了 kind , 以及 node.

◆ findLink() [2/2]

SceneLink * eve::scene::SceneHost::findLink ( SceneNode *  node,
int  kind 
)

在文件 SceneHost.cpp 第 675 行定义.

引用了 kind , 以及 node.

◆ fireEvent()

void eve::scene::SceneHost::fireEvent ( const std::string &  action,
const std::string &  nodeId,
const std::string &  parentId = {} 
)

Fire "node_added" / "node_removed" / "node_moved" / "node_changed".

在文件 SceneHost.cpp 第 501 行定义.

引用了 action, nodeId , 以及 parentId.

被这些函数引用 appendNode(), removeChild(), removeLeaf(), renameNode(), setLocalTransform() , 以及 setParent().

◆ forEachDepthFirst()

void eve::scene::SceneHost::forEachDepthFirst ( int  nodeIndex,
void(*)(SceneHost *, int, void *)  fn,
void *  user 
)

Depth-first visit of arena indices under nodeIndex (inclusive). C callback.

在文件 SceneHost.cpp 第 506 行定义.

引用了 fn , 以及 nodeIndex.

◆ getChildAt()

SceneNode * eve::scene::SceneHost::getChildAt ( int  parentIndex,
int  childOrdinal 
)

在文件 SceneHost.cpp 第 389 行定义.

引用了 getChildIndexAt() , 以及 getNode().

被这些函数引用 getChildAtById().

◆ getChildAtById()

SceneNode * eve::scene::SceneHost::getChildAtById ( const std::string &  parentId,
int  childOrdinal 
)

在文件 SceneHost.cpp 第 393 行定义.

引用了 findIndexById(), getChildAt() , 以及 parentId.

◆ getChildCount()

int eve::scene::SceneHost::getChildCount ( int  nodeIndex)

在文件 SceneHost.cpp 第 363 行定义.

引用了 c, count, nodeIndex , 以及 t.

被这些函数引用 getChildCountById().

◆ getChildCountById()

int eve::scene::SceneHost::getChildCountById ( const std::string &  id)

在文件 SceneHost.cpp 第 374 行定义.

引用了 findIndexById() , 以及 getChildCount().

被这些函数引用 eve::scene::Scene::getChildCount().

◆ getChildIds()

std::vector< std::string > eve::scene::SceneHost::getChildIds ( const std::string &  parentId)

在文件 SceneHost.cpp 第 414 行定义.

引用了 findIndexById(), getChildren(), n , 以及 parentId.

被这些函数引用 eve::scene::Scene::collectChildIds().

◆ getChildIndexAt()

int eve::scene::SceneHost::getChildIndexAt ( int  parentIndex,
int  childOrdinal 
)

Child ordinal 0..count-1; -1 if out of range.

在文件 SceneHost.cpp 第 376 行定义.

引用了 c , 以及 t.

被这些函数引用 getChildAt().

◆ getChildIndices()

std::vector< int > eve::scene::SceneHost::getChildIndices ( int  nodeIndex)

在文件 SceneHost.cpp 第 397 行定义.

引用了 c, nodeIndex , 以及 t.

被这些函数引用 getChildren() , 以及 walkChildren().

◆ getChildren()

std::vector< SceneNode * > eve::scene::SceneHost::getChildren ( int  nodeIndex)

在文件 SceneHost.cpp 第 408 行定义.

引用了 c, getChildIndices() , 以及 nodeIndex.

被这些函数引用 getChildIds().

◆ getName()

const std::string & eve::scene::SceneHost::getName ( )

在文件 SceneHost.cpp 第 145 行定义.

◆ getNode()

SceneNode * eve::scene::SceneHost::getNode ( int  index)

在文件 SceneHost.cpp 第 347 行定义.

引用了 index , 以及 t.

被这些函数引用 getChildAt() , 以及 getParent().

◆ getNodeCount()

int eve::scene::SceneHost::getNodeCount ( )

在文件 SceneHost.cpp 第 337 行定义.

引用了 nodes.

被这些函数引用 eve::scene::Scene::getNodeCount().

◆ getOwnerId()

uint32_t eve::scene::SceneHost::getOwnerId ( )
inline

在文件 SceneHost.h 第 140 行定义.

◆ getParent()

SceneNode * eve::scene::SceneHost::getParent ( int  nodeIndex)

在文件 SceneHost.cpp 第 359 行定义.

引用了 getNode(), getParentIndex() , 以及 nodeIndex.

被这些函数引用 getParentById().

◆ getParentById()

SceneNode * eve::scene::SceneHost::getParentById ( const std::string &  id)

在文件 SceneHost.cpp 第 361 行定义.

引用了 findIndexById() , 以及 getParent().

◆ getParentIndex()

int eve::scene::SceneHost::getParentIndex ( int  nodeIndex)

在文件 SceneHost.cpp 第 353 行定义.

引用了 nodeIndex , 以及 t.

被这些函数引用 getParent().

◆ getPath()

std::string eve::scene::SceneHost::getPath ( int  nodeIndex)

Id path "a/b/c" from root to node; empty if invalid.

在文件 SceneHost.cpp 第 422 行定义.

引用了 nodeIndex, parts, path , 以及 t.

被这些函数引用 getPathById().

◆ getPathById()

std::string eve::scene::SceneHost::getPathById ( const std::string &  id)

在文件 SceneHost.cpp 第 437 行定义.

引用了 findIndexById() , 以及 getPath().

被这些函数引用 eve::scene::Scene::getNodePath().

◆ getRoot()

SceneNode * eve::scene::SceneHost::getRoot ( )

在文件 SceneHost.cpp 第 341 行定义.

引用了 r.

◆ getRootIndex()

int eve::scene::SceneHost::getRootIndex ( )

在文件 SceneHost.cpp 第 339 行定义.

◆ hasNode()

bool eve::scene::SceneHost::hasNode ( const std::string &  id)

在文件 SceneHost.cpp 第 335 行定义.

引用了 findIndexById().

被这些函数引用 appendNode() , 以及 eve::scene::Scene::hasNode().

◆ hasTag()

bool eve::scene::SceneHost::hasTag ( const SceneNode *  node,
const std::string &  tag 
) const

在文件 SceneHost.cpp 第 731 行定义.

引用了 node, t , 以及 tag.

◆ invalidateIndex()

void eve::scene::SceneHost::invalidateIndex ( )
inline

在文件 SceneHost.h 第 207 行定义.

◆ isAncestorOf()

bool eve::scene::SceneHost::isAncestorOf ( int  ancestorIndex,
int  nodeIndex 
)

在文件 SceneHost.cpp 第 439 行定义.

引用了 nodeIndex , 以及 t.

被这些函数引用 isAncestorOfById() , 以及 isDescendantOf().

◆ isAncestorOfById()

bool eve::scene::SceneHost::isAncestorOfById ( const std::string &  ancestorId,
const std::string &  nodeId 
)

在文件 SceneHost.cpp 第 446 行定义.

引用了 findIndexById(), isAncestorOf() , 以及 nodeId.

被这些函数引用 eve::scene::Scene::isAncestor() , 以及 isDescendantOfById().

◆ isDescendantOf()

bool eve::scene::SceneHost::isDescendantOf ( int  nodeIndex,
int  ancestorIndex 
)

在文件 SceneHost.cpp 第 450 行定义.

引用了 isAncestorOf() , 以及 nodeIndex.

◆ isDescendantOfById()

bool eve::scene::SceneHost::isDescendantOfById ( const std::string &  nodeId,
const std::string &  ancestorId 
)

在文件 SceneHost.cpp 第 454 行定义.

引用了 isAncestorOfById() , 以及 nodeId.

被这些函数引用 eve::scene::Scene::isDescendant().

◆ link()

bool eve::scene::SceneHost::link ( const std::string &  nodeId,
int  kind,
void *  target,
int  syncMode = 0 
)

Attach an external object to a node id. Survives reconcile/rebuild by id. After TransformSystem the link is synced per kind (and syncMode).

kind is an id from scene::registerLinkKind, so any module can attach to the tree; the typed helpers below are conveniences for the kinds the engine ships. Returns false when the node or the kind is unknown.

在文件 SceneHost.cpp 第 624 行定义.

引用了 findById(), kind, eve::scene::linkOps(), n, nodeId , 以及 target.

被这些函数引用 linkAudio3D(), linkCamera3D(), linkPhysics2D(), linkPhysics3D(), linkRenderable2D() , 以及 linkRenderable3D().

◆ linkAudio3D()

bool eve::scene::SceneHost::linkAudio3D ( const std::string &  nodeId,
audio::Source *  s 
)

在文件 SceneHost.cpp 第 652 行定义.

引用了 eve::scene::findLinkKind(), link(), nodeId , 以及 s.

◆ linkCamera3D()

bool eve::scene::SceneHost::linkCamera3D ( const std::string &  nodeId,
graphics::Camera3D *  c 
)

在文件 SceneHost.cpp 第 648 行定义.

引用了 c, eve::scene::findLinkKind(), link() , 以及 nodeId.

◆ linkCount()

int eve::scene::SceneHost::linkCount ( const std::string &  nodeId)

在文件 SceneHost.cpp 第 691 行定义.

引用了 findById(), n , 以及 nodeId.

◆ linkPhysics2D()

bool eve::scene::SceneHost::linkPhysics2D ( const std::string &  nodeId,
physics::Body *  b,
int  syncMode = 0 
)

在文件 SceneHost.cpp 第 640 行定义.

引用了 b, eve::scene::findLinkKind(), link() , 以及 nodeId.

◆ linkPhysics3D()

bool eve::scene::SceneHost::linkPhysics3D ( const std::string &  nodeId,
physics::Body3D *  b,
int  syncMode = 0 
)

在文件 SceneHost.cpp 第 644 行定义.

引用了 b, eve::scene::findLinkKind(), link() , 以及 nodeId.

◆ linkRenderable2D()

bool eve::scene::SceneHost::linkRenderable2D ( const std::string &  nodeId,
graphics::Renderable2D *  r 
)

在文件 SceneHost.cpp 第 632 行定义.

引用了 eve::scene::findLinkKind(), link(), nodeId , 以及 r.

◆ linkRenderable3D()

bool eve::scene::SceneHost::linkRenderable3D ( const std::string &  nodeId,
graphics::Renderable3D *  r 
)

在文件 SceneHost.cpp 第 636 行定义.

引用了 eve::scene::findLinkKind(), link(), nodeId , 以及 r.

◆ markDirty()

void eve::scene::SceneHost::markDirty ( )
inline

在文件 SceneHost.h 第 200 行定义.

◆ markSubtreeDirty()

void eve::scene::SceneHost::markSubtreeDirty ( int  nodeIndex)

Mark a node's subtree for world recompute (recompute it + descendants).

在文件 SceneHost.cpp 第 494 行定义.

引用了 nodeIndex , 以及 t.

被这些函数引用 removeChild(), setLocalTransform() , 以及 setParent().

◆ markSubtreeDirtyById()

void eve::scene::SceneHost::markSubtreeDirtyById ( const std::string &  nodeId)
inline

在文件 SceneHost.h 第 204 行定义.

引用了 nodeId.

◆ markTransformDirty()

void eve::scene::SceneHost::markTransformDirty ( )
inline

在文件 SceneHost.h 第 201 行定义.

◆ release()

void eve::scene::SceneHost::release ( )
inlineoverride

Entity.

Release.

在文件 SceneHost.h 第 95 行定义.

◆ removeChild()

bool eve::scene::SceneHost::removeChild ( int  parentIndex,
int  childIndex 
)

在文件 SceneHost.cpp 第 483 行定义.

引用了 fireEvent(), markSubtreeDirty() , 以及 t.

被这些函数引用 removeChildById().

◆ removeChildById()

bool eve::scene::SceneHost::removeChildById ( const std::string &  parentId,
const std::string &  childId 
)

在文件 SceneHost.cpp 第 704 行定义.

引用了 findIndexById(), parentId , 以及 removeChild().

◆ removeLeaf()

SceneMutationStatus eve::scene::SceneHost::removeLeaf ( const std::string &  nodeId)

Remove a leaf node while preserving every other node and external link.

参数
nodeIdStable id of a node without children.
返回
True when the leaf existed and was removed.
备注
Removal compacts the arena and invalidates borrowed SceneNode pointers.

在文件 SceneHost.cpp 第 174 行定义.

引用了 eve::scene::Applied, findIndexById(), fireEvent(), index, node, nodeId, nodes, parentId, eve::scene::Rejected , 以及 value.

◆ removeTag()

bool eve::scene::SceneHost::removeTag ( SceneNode *  node,
const std::string &  tag 
)

在文件 SceneHost.cpp 第 720 行定义.

引用了 node , 以及 tag.

◆ renameNode()

SceneMutationStatus eve::scene::SceneHost::renameNode ( const std::string &  nodeId,
const std::string &  name 
)

Rename a retained node and emit a node_changed event.

在文件 SceneHost.cpp 第 198 行定义.

引用了 eve::scene::Applied, findIndexById(), fireEvent(), index, name, nodeId , 以及 eve::scene::Rejected.

◆ setEventHandler()

void eve::scene::SceneHost::setEventHandler ( SceneEventFn  fn)
inline

在文件 SceneHost.h 第 213 行定义.

引用了 fn.

◆ setLayer()

void eve::scene::SceneHost::setLayer ( int  layer)
inline

在文件 SceneHost.h 第 219 行定义.

引用了 layer.

◆ setLocalTransform()

SceneMutationStatus eve::scene::SceneHost::setLocalTransform ( const std::string &  nodeId,
float  x,
float  y,
float  z,
float  yaw,
float  pitch,
float  roll,
float  sx,
float  sy,
float  sz 
)

Replace a node's local TRS and mark its subtree dirty.

在文件 SceneHost.cpp 第 208 行定义.

引用了 eve::scene::Applied, findIndexById(), fireEvent(), index, markSubtreeDirty(), node, nodeId, pitch, eve::scene::Rejected, roll, sx, sy, sz, x, eve::scene::SceneNode::x, y, yaw , 以及 z.

◆ setName()

void eve::scene::SceneHost::setName ( const std::string &  name)

在文件 SceneHost.cpp 第 143 行定义.

引用了 name.

◆ setOwnerId()

void eve::scene::SceneHost::setOwnerId ( uint32_t  ownerId)
inline

在文件 SceneHost.h 第 139 行定义.

◆ setParent()

bool eve::scene::SceneHost::setParent ( int  childIndex,
int  parentIndex 
)

Imperative parent link. Returns false on invalid indices or cycle. Prefer declarative NodeDesc + reconcile for normal use.

在文件 SceneHost.cpp 第 458 行定义.

引用了 fireEvent(), markSubtreeDirty() , 以及 t.

被这些函数引用 addChild() , 以及 setParentById().

◆ setParentById()

bool eve::scene::SceneHost::setParentById ( const std::string &  childId,
const std::string &  parentId 
)

Reparent by id; empty parentId detaches (parent = -1). Cycle-safe.

在文件 SceneHost.cpp 第 696 行定义.

引用了 findIndexById(), parentId , 以及 setParent().

◆ setTree()

void eve::scene::SceneHost::setTree ( NodeDesc  root)

Full replace.

在文件 SceneHost.cpp 第 147 行定义.

引用了 eve::scene::applyTree() , 以及 root.

被这些函数引用 eve::scene::SceneComponent::rebuild().

◆ setTreeReconcile()

bool eve::scene::SceneHost::setTreeReconcile ( NodeDesc  root)

Key-aware patch when structure matches; else full replace.

在文件 SceneHost.cpp 第 149 行定义.

引用了 eve::scene::applyTreeReconcile() , 以及 root.

被这些函数引用 eve::scene::SceneComponent::rebuild().

◆ setVisible()

void eve::scene::SceneHost::setVisible ( bool  v)
inline

在文件 SceneHost.h 第 218 行定义.

引用了 v.

◆ unlink() [1/2]

bool eve::scene::SceneHost::unlink ( const std::string &  nodeId)

Remove every link on the node.

在文件 SceneHost.cpp 第 668 行定义.

引用了 findById(), n , 以及 nodeId.

◆ unlink() [2/2]

bool eve::scene::SceneHost::unlink ( const std::string &  nodeId,
int  kind 
)

Remove all links of a kind; returns true if a link was removed.

在文件 SceneHost.cpp 第 656 行定义.

引用了 findById(), kind, n , 以及 nodeId.

◆ walkAncestors()

void eve::scene::SceneHost::walkAncestors ( int  nodeIndex,
NodeVisitFn  fn 
)

Parent chain upward, excluding self.

在文件 SceneHost.cpp 第 531 行定义.

引用了 fn, nodeIndex, p , 以及 t.

◆ walkBreadthFirst()

void eve::scene::SceneHost::walkBreadthFirst ( NodeVisitFn  fn)

BFS from root (or from nodeIndex), inclusive.

在文件 SceneHost.cpp 第 516 行定义.

引用了 fn, root , 以及 walkBreadthFirstFrom().

被这些函数引用 eve::scene::Scene::walkBreadthFirstIds().

◆ walkBreadthFirstFrom()

void eve::scene::SceneHost::walkBreadthFirstFrom ( int  nodeIndex,
NodeVisitFn  fn 
)

在文件 SceneHost.cpp 第 520 行定义.

引用了 fn , 以及 nodeIndex.

被这些函数引用 walkBreadthFirst().

◆ walkChildren()

void eve::scene::SceneHost::walkChildren ( int  parentIndex,
NodeVisitFn  fn 
)

Direct children only.

在文件 SceneHost.cpp 第 524 行定义.

引用了 c, fn, getChildIndices() , 以及 nodes.

◆ walkDepthFirst()

void eve::scene::SceneHost::walkDepthFirst ( NodeVisitFn  fn)

DFS from root (or from nodeIndex), inclusive.

在文件 SceneHost.cpp 第 510 行定义.

引用了 fn, root , 以及 walkDepthFirstFrom().

被这些函数引用 findIndexByName().

◆ walkDepthFirstFrom()

void eve::scene::SceneHost::walkDepthFirstFrom ( int  nodeIndex,
NodeVisitFn  fn 
)

在文件 SceneHost.cpp 第 512 行定义.

引用了 fn , 以及 nodeIndex.

被这些函数引用 collectIdsFrom(), filterFrom(), filterIndicesFrom(), findIfFrom() , 以及 walkDepthFirst().


该类的文档由以下文件生成: