载入中...
搜索中...
未找到
eve::scene::Scene类 参考

Declarative scene module (eve.Scene). 更多...

#include <Scene.h>

类 eve::scene::Scene 继承关系图:
eve::Module

Public 成员函数

 Module_REG (Scene)
 
 Scene ()
 Scene.
 
 ~Scene () override
 Tears down script bindings and delayed-detach state.
 
eve::Result< SceneHost * > mountAs (const std::string &name, NodeDesc root)
 Creates/replaces a named host from a NodeDesc tree and selects it.
 
eve::Result< SceneHost * > mount (NodeDesc root)
 Mounts the tree as the default host and selects it.
 
eve::Result< SceneHost * > remount (NodeDesc root)
 Replaces the selected host's tree.
 
eve::Result< SceneHost * > remountReconcile (NodeDesc root)
 Reconciles the selected host, reporting whether replacement failed.
 
eve::Result< SceneHost * > remountAs (const std::string &name, NodeDesc root)
 Creates/replaces a named host through the canonical mount path.
 
bool select (const std::string &name)
 Selects a named host; false when it does not exist.
 
eve::Result< SceneHost * > findHost (const std::string &name) const
 Finds a host by name with an explicit not-found status.
 
eve::Result< SceneHost * > findHostByOwner (uint32_t ownerId) const
 Finds the host bound to an owner id with an explicit status.
 
SceneHost * current () const noexcept
 Currently selected borrowed host, or nullptr.
 
void bindOwner (uint32_t ownerId)
 Binds the selected host to a UI/scene owner id.
 
void setHostVisible (bool visible)
 Shows/hides every host (or the selected one when a host is selected).
 
void setHostLayer (int layer)
 Sets the render layer of every host (or the selected one).
 
void updateTransforms ()
 Propagate transforms (+ link sync) for all hosts (or current if selected).
 
void updateTransformsAll ()
 Propagate transforms for every host regardless of selection.
 
bool setNodePosition (const std::string &id, float x, float y, float z)
 Script-friendly TRS setters on the current host; each marks the transform dirty.
 
bool setNodeRotation (const std::string &id, float yaw, float pitch, float roll)
 Sets the local rotation (yaw/pitch/roll in degrees) of a node.
 
bool setNodeScale (const std::string &id, float sx, float sy, float sz)
 Sets the local scale of a node.
 
bool setNodeVisible (const std::string &id, bool visible)
 Shows/hides a node.
 
bool linkRenderable2D (const std::string &nodeId, graphics::Renderable2D *r)
 Links a 2D renderable to a node in the current host.
 
bool linkRenderable3D (const std::string &nodeId, graphics::Renderable3D *r)
 Links a 3D renderable to a node in the current host.
 
bool unlinkNode (const std::string &nodeId)
 Removes every link on a node in the current host.
 
bool linkRenderable2DAt (const std::string &hostName, const std::string &nodeId, graphics::Renderable2D *r)
 Link renderable 2 d at.
 
bool linkRenderable3DAt (const std::string &hostName, const std::string &nodeId, graphics::Renderable3D *r)
 Link renderable 3 d at.
 
bool linkPhysics2DAt (const std::string &hostName, const std::string &nodeId, physics::Body *b, const std::string &mode)
 Link physics 2 d at.
 
bool linkPhysics3DAt (const std::string &hostName, const std::string &nodeId, physics::Body3D *b, const std::string &mode)
 Link physics 3 d at.
 
bool linkCamera3DAt (const std::string &hostName, const std::string &nodeId, graphics::Camera3D *c)
 Link camera 3 d at.
 
bool linkAudio3DAt (const std::string &hostName, const std::string &nodeId, audio::Source *s)
 Link audio 3 d at.
 
bool unlinkNodeAt (const std::string &hostName, const std::string &nodeId)
 Remove every link on the node.
 
bool unlinkNodeKindAt (const std::string &hostName, const std::string &nodeId, const std::string &kind)
 Remove links of one kind ("renderable2d"|"renderable3d"|"physics2d"|...).
 
int linkCountAt (const std::string &hostName, const std::string &nodeId)
 Link count at.
 
std::vector< float > getNodePositionAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node position at.
 
std::vector< float > getNodeRotationAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node rotation at.
 
std::vector< float > getNodeScaleAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node scale at.
 
bool getNodeVisibleAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node visible at.
 
std::vector< float > getNodeWorldPositionAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node world position at.
 
std::vector< float > getNodeWorldRotationAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node world rotation at.
 
std::vector< float > getNodeWorldScaleAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node world scale at.
 
std::vector< float > localToWorldAt (const std::string &hostName, const std::string &nodeId, float x, float y, float z) const
 Local to world at.
 
std::vector< float > worldToLocalAt (const std::string &hostName, const std::string &nodeId, float x, float y, float z) const
 World to local at.
 
bool setNodeParentAt (const std::string &hostName, const std::string &childId, const std::string &parentId)
 Reparent by id; empty parentId detaches. Cycle-safe.
 
bool removeNodeAt (const std::string &hostName, const std::string &nodeId)
 Detach node from its parent (arena node stays; rebuild to delete).
 
bool addChildAt (const std::string &hostName, const std::string &parentId, const std::string &childId)
 Adds child at.
 
bool removeChildAt (const std::string &hostName, const std::string &parentId, const std::string &childId)
 Removes child at.
 
bool setNodeQuaternionAt (const std::string &hostName, const std::string &nodeId, float qx, float qy, float qz, float qw)
 Sets the node quaternion at.
 
std::vector< float > getNodeQuaternionAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node quaternion at.
 
bool setNodeLookAtAt (const std::string &hostName, const std::string &nodeId, float tx, float ty, float tz)
 Orient node so its local +Z axis points at (tx,ty,tz).
 
bool addNodeTagAt (const std::string &hostName, const std::string &nodeId, const std::string &tag)
 Adds node tag at.
 
bool removeNodeTagAt (const std::string &hostName, const std::string &nodeId, const std::string &tag)
 Removes node tag at.
 
bool hasNodeTagAt (const std::string &hostName, const std::string &nodeId, const std::string &tag) const
 True when node tag at.
 
std::vector< std::string > getNodeTagsAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node tags at.
 
std::vector< std::string > collectIdsByTagAt (const std::string &hostName, const std::string &tag) const
 Collect ids by tag at.
 
bool setNodeLayerAt (const std::string &hostName, const std::string &nodeId, int layer)
 Sets the node layer at.
 
int getNodeLayerAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node layer at.
 
bool setNodeEventHandlerAt (const std::string &hostName, ssq::Object cb)
 Register a script callback for node lifecycle events on a host: The callback receives action, nodeId and parentId; action is one of {"node_added","node_removed","node_moved","node_changed"}. Pass null cb to clear. Rooted for the process lifetime.
 
bool setNodeBoundsAt (const std::string &hostName, const std::string &nodeId, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 Sets the node bounds at.
 
bool hasNodeBoundsAt (const std::string &hostName, const std::string &nodeId) const
 True when node bounds at.
 
std::vector< float > getNodeBoundsAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node bounds at.
 
std::string serializeHostAt (const std::string &hostName) const
 Serialize host at.
 
bool deserializeHostAt (const std::string &hostName, const std::string &json)
 Deserialize host at.
 
std::string pickRayAt (const std::string &hostName, float ox, float oy, float oz, float dx, float dy, float dz) const
 Nearest node id hit by a world ray (nodes with bounds), or "".
 
std::string pickScreenAt (const std::string &hostName, graphics::Camera3D *cam, float screenX, float screenY, float viewW, float viewH) const
 Screen-space picking through a Camera3D (camera.screenToRay).
 
std::vector< std::string > collectFrustumIdsAt (const std::string &hostName, graphics::Camera3D *cam, float viewW, float viewH) const
 Ids of nodes whose world AABB intersects the camera frustum.
 
Result< int > applyPcgTerrainCullingAt (const std::string &hostName, graphics::Camera3D *cam, float viewW, float viewH, const std::string &tag)
 Apply PcgScenePlayer frustum visibility to bounded nodes carrying a tag.
 
bool syncSpatialIndexAt (const std::string &hostName, spatial::Octree *ot) const
 Insert every bounded node's world AABB into an octree (id = arena index).
 
std::string nodeIdFromSpatialIdAt (const std::string &hostName, int index) const
 Map a spatial-index id (arena index) back to a node id.
 
bool hasNode (const std::string &id)
 True when node.
 
int getNodeCount ()
 Returns the node count.
 
std::string getRootId ()
 Returns the root id.
 
std::string getParentId (const std::string &id)
 Returns the parent id.
 
int getChildCount (const std::string &id)
 Returns the child count.
 
std::string getChildIdAt (const std::string &parentId, int childOrdinal)
 Returns the child id at.
 
std::string findIdByName (const std::string &name)
 Finds id by name.
 
std::string findIdByPath (const std::string &path)
 Finds id by path.
 
std::string getNodePath (const std::string &id)
 Returns the node path.
 
bool isAncestor (const std::string &ancestorId, const std::string &nodeId)
 True when ancestor.
 
bool isDescendant (const std::string &nodeId, const std::string &ancestorId)
 True when descendant.
 
std::vector< std::string > collectIds ()
 Collect ids.
 
std::vector< std::string > collectIdsFrom (const std::string &id)
 Collect ids from.
 
std::vector< std::string > collectIdsByName (const std::string &name)
 Collect ids by name.
 
std::vector< std::string > collectIdsVisible (bool visible)
 Collect ids visible.
 
std::vector< std::string > collectChildIds (const std::string &parentId)
 Collect child ids.
 
std::vector< std::string > walkDepthFirstIds ()
 DFS order of ids under root (same as collectIds). Kept for script naming clarity.
 
std::vector< std::string > walkBreadthFirstIds ()
 Walk breadth first ids.
 
void beginBuild ()
 Begins build.
 
void beginNode (const std::string &id, const std::string &name="")
 Begins node.
 
void beginGroup (const std::string &id="")
 Begins group.
 
void end ()
 Ends .
 
void addNode (const std::string &id, const std::string &name="")
 Adds node.
 
void setBuildPosition (float x, float y, float z=0.f)
 Sets the build position.
 
void setBuildRotation (float yaw, float pitch=0.f, float roll=0.f)
 Sets the build rotation.
 
void setBuildScale (float sx, float sy, float sz=1.f)
 Sets the build scale.
 
void setBuildSpace (const std::string &space)
 Sets the build space.
 
void setBuildVisible (bool visible)
 Sets the build visible.
 
bool mountBuild ()
 Mounts build.
 
bool mountBuildAs (const std::string &name)
 Mounts build as.
 
bool remountBuildAs (const std::string &name)
 Remount build as.
 
SceneHost * resolveHost (const std::string &hostName) const
 Host-qualified resolution: empty hostName → currently selected host.
 
bool rootEntity (const std::string &hostName, const std::string &nodeId, ssq::Object instance)
 Root one script instance on a node (creates SceneObject lazily).
 
bool unrootEntityAt (const std::string &hostName, const std::string &nodeId, int index)
 Remove a rooted script instance by its index in the binding list.
 
int forEachEntity (const std::string &hostName, const std::string &nodeId, ssq::Object cb)
 Call cb(instance, index) for every rooted instance; returns count.
 
void updateScripts (float dt)
 updateTransformsAll() + call update(dt) on every rooted instance.
 
eve::Result< void > scheduleDetachEntityAt (const std::string &hostName, const std::string &nodeId, ssq::Object instance)
 Queue a script instance for detach at the end of the current/next updateScripts.
 
void flushDelayedDetaches ()
 Drain the delayed-detach queue (called automatically by updateScripts).
 
std::string currentHostName () const
 Current host name.
 
SceneNodeRef * getNodeRefAt (const std::string &hostName, const std::string &nodeId) const
 Returns the node ref at.
 
SceneNodeRef * getNodeRefByPathAt (const std::string &hostName, const std::string &path) const
 Returns the node ref by path at.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 Module.
 
virtual std::string getName () const =0
 Returns the name.
 

详细描述

Declarative scene module (eve.Scene).

Isomorphic to eve::ui::UI: named SceneHost graphs, NodeDesc + SceneComponent.build, mount / remountReconcile / beginBuild. TransformSystem propagates world matrices and syncs linked Renderable2D/3D transforms.

在文件 Scene.h 第 51 行定义.

构造及析构函数说明

◆ Scene()

eve::scene::Scene::Scene ( )

◆ ~Scene()

eve::scene::Scene::~Scene ( )
override

Tears down script bindings and delayed-detach state.

在文件 Scene.cpp 第 43 行定义.

成员函数说明

◆ addChildAt()

bool eve::scene::Scene::addChildAt ( const std::string &  hostName,
const std::string &  parentId,
const std::string &  childId 
)

Adds child at.

在文件 SceneNodes.cpp 第 273 行定义.

引用了 h, ok, parentId, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ addNode()

void eve::scene::Scene::addNode ( const std::string &  id,
const std::string &  name = "" 
)

Adds node.

在文件 Scene.cpp 第 878 行定义.

◆ addNodeTagAt()

bool eve::scene::Scene::addNodeTagAt ( const std::string &  hostName,
const std::string &  nodeId,
const std::string &  tag 
)

Adds node tag at.

在文件 SceneNodes.cpp 第 338 行定义.

引用了 h, n, nodeId, resolveHost() , 以及 tag.

◆ applyPcgTerrainCullingAt()

Result< int > eve::scene::Scene::applyPcgTerrainCullingAt ( const std::string &  hostName,
graphics::Camera3D *  cam,
float  viewW,
float  viewH,
const std::string &  tag 
)

Apply PcgScenePlayer frustum visibility to bounded nodes carrying a tag.

参数
hostNameScene host to mutate.
camBorrowed camera used only during this call.
viewWPositive viewport width.
viewHPositive viewport height.
tagTerrain classification tag, such as terrain or mesh-terrain.
返回
Number of visibility values changed. @ownership The caller retains the camera; this function retains no pointer. @lifetime Camera must remain valid for the duration of the call.

在文件 SceneCameraQueries.cpp 第 58 行定义.

引用了 eve::scene::aabbIntersectsFrustum(), clip, eve::Diagnostic::error(), eve::Result< T >::failure(), host, eve::InvalidArgument, node, resolveHost(), eve::Result< T >::success(), tag, eve::Unsupported, visible , 以及 eve::scene::worldBoundsOf().

◆ beginBuild()

void eve::scene::Scene::beginBuild ( )

Begins build.

在文件 Scene.cpp 第 843 行定义.

被这些函数引用 bindOwner().

◆ beginGroup()

void eve::scene::Scene::beginGroup ( const std::string &  id = "")

Begins group.

在文件 Scene.cpp 第 861 行定义.

◆ beginNode()

void eve::scene::Scene::beginNode ( const std::string &  id,
const std::string &  name = "" 
)

Begins node.

在文件 Scene.cpp 第 856 行定义.

◆ bindOwner()

void eve::scene::Scene::bindOwner ( uint32_t  ownerId)

Binds the selected host to a UI/scene owner id.

在文件 Scene.cpp 第 782 行定义.

引用了 beginBuild(), group , 以及 id.

◆ collectChildIds()

std::vector< std::string > eve::scene::Scene::collectChildIds ( const std::string &  parentId)

Collect child ids.

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

引用了 eve::scene::SceneHost::getChildIds(), h , 以及 parentId.

◆ collectFrustumIdsAt()

std::vector< std::string > eve::scene::Scene::collectFrustumIdsAt ( const std::string &  hostName,
graphics::Camera3D *  cam,
float  viewW,
float  viewH 
) const

Ids of nodes whose world AABB intersects the camera frustum.

在文件 SceneCameraQueries.cpp 第 39 行定义.

引用了 eve::scene::aabbIntersectsFrustum(), clip, h, n, resolveHost() , 以及 eve::scene::worldBoundsOf().

◆ collectIds()

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

Collect ids.

在文件 SceneNodes.cpp 第 579 行定义.

引用了 eve::scene::SceneHost::collectIds() , 以及 h.

被这些函数引用 walkDepthFirstIds().

◆ collectIdsByName()

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

Collect ids by name.

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

引用了 eve::scene::SceneHost::collectIdsByName(), h , 以及 name.

◆ collectIdsByTagAt()

std::vector< std::string > eve::scene::Scene::collectIdsByTagAt ( const std::string &  hostName,
const std::string &  tag 
) const

Collect ids by tag at.

在文件 SceneNodes.cpp 第 367 行定义.

引用了 h, n, resolveHost() , 以及 tag.

◆ collectIdsFrom()

std::vector< std::string > eve::scene::Scene::collectIdsFrom ( const std::string &  id)

Collect ids from.

在文件 SceneNodes.cpp 第 584 行定义.

引用了 eve::scene::SceneHost::collectIdsFrom() , 以及 h.

◆ collectIdsVisible()

std::vector< std::string > eve::scene::Scene::collectIdsVisible ( bool  visible)

Collect ids visible.

在文件 SceneNodes.cpp 第 595 行定义.

引用了 eve::scene::SceneHost::collectIdsVisible(), h , 以及 visible.

◆ current()

SceneHost * eve::scene::Scene::current ( ) const
inlinenoexcept

Currently selected borrowed host, or nullptr.

在文件 Scene.h 第 100 行定义.

◆ currentHostName()

std::string eve::scene::Scene::currentHostName ( ) const

Current host name.

在文件 Scene.cpp 第 1174 行定义.

被这些函数引用 linkRenderable2D(), linkRenderable3D() , 以及 unlinkNode().

◆ deserializeHostAt()

bool eve::scene::Scene::deserializeHostAt ( const std::string &  hostName,
const std::string &  json 
)

Deserialize host at.

在文件 Scene.cpp 第 836 行定义.

◆ end()

void eve::scene::Scene::end ( )

Ends .

在文件 Scene.cpp 第 866 行定义.

◆ findHost()

eve::Result< SceneHost * > eve::scene::Scene::findHost ( const std::string &  name) const

Finds a host by name with an explicit not-found status.

返回
Borrowed ECS-owned host, or a structured not-found/argument failure.

在文件 Scene.cpp 第 763 行定义.

◆ findHostByOwner()

eve::Result< SceneHost * > eve::scene::Scene::findHostByOwner ( uint32_t  ownerId) const

Finds the host bound to an owner id with an explicit status.

返回
Borrowed ECS-owned host, or a structured not-found/argument failure.

在文件 Scene.cpp 第 772 行定义.

◆ findIdByName()

std::string eve::scene::Scene::findIdByName ( const std::string &  name)

Finds id by name.

在文件 SceneNodes.cpp 第 550 行定义.

引用了 h, n , 以及 name.

◆ findIdByPath()

std::string eve::scene::Scene::findIdByPath ( const std::string &  path)

Finds id by path.

在文件 SceneNodes.cpp 第 557 行定义.

引用了 h, n , 以及 path.

◆ flushDelayedDetaches()

void eve::scene::Scene::flushDelayedDetaches ( )

Drain the delayed-detach queue (called automatically by updateScripts).

在文件 Scene.cpp 第 1147 行定义.

◆ forEachEntity()

int eve::scene::Scene::forEachEntity ( const std::string &  hostName,
const std::string &  nodeId,
ssq::Object  cb 
)

Call cb(instance, index) for every rooted instance; returns count.

在文件 Scene.cpp 第 1039 行定义.

◆ getChildCount()

int eve::scene::Scene::getChildCount ( const std::string &  id)

Returns the child count.

在文件 SceneNodes.cpp 第 538 行定义.

引用了 eve::scene::SceneHost::getChildCountById() , 以及 h.

◆ getChildIdAt()

std::string eve::scene::Scene::getChildIdAt ( const std::string &  parentId,
int  childOrdinal 
)

Returns the child id at.

在文件 SceneNodes.cpp 第 543 行定义.

引用了 c, h, eve::scene::SceneNode::id , 以及 parentId.

◆ getNodeBoundsAt()

std::vector< float > eve::scene::Scene::getNodeBoundsAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node bounds at.

在文件 SceneNodes.cpp 第 463 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodeCount()

int eve::scene::Scene::getNodeCount ( )

Returns the node count.

在文件 SceneNodes.cpp 第 519 行定义.

引用了 eve::scene::SceneHost::getNodeCount() , 以及 h.

◆ getNodeLayerAt()

int eve::scene::Scene::getNodeLayerAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node layer at.

在文件 SceneNodes.cpp 第 387 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodePath()

std::string eve::scene::Scene::getNodePath ( const std::string &  id)

Returns the node path.

在文件 SceneNodes.cpp 第 564 行定义.

引用了 eve::scene::SceneHost::getPathById() , 以及 h.

◆ getNodePositionAt()

std::vector< float > eve::scene::Scene::getNodePositionAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node position at.

在文件 SceneNodes.cpp 第 177 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodeQuaternionAt()

std::vector< float > eve::scene::Scene::getNodeQuaternionAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node quaternion at.

在文件 SceneNodes.cpp 第 305 行定义.

引用了 h, n, nodeId, q , 以及 resolveHost().

◆ getNodeRefAt()

SceneNodeRef * eve::scene::Scene::getNodeRefAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node ref at.

在文件 Scene.cpp 第 1178 行定义.

◆ getNodeRefByPathAt()

SceneNodeRef * eve::scene::Scene::getNodeRefByPathAt ( const std::string &  hostName,
const std::string &  path 
) const

Returns the node ref by path at.

在文件 Scene.cpp 第 1186 行定义.

◆ getNodeRotationAt()

std::vector< float > eve::scene::Scene::getNodeRotationAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node rotation at.

在文件 SceneNodes.cpp 第 185 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodeScaleAt()

std::vector< float > eve::scene::Scene::getNodeScaleAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node scale at.

在文件 SceneNodes.cpp 第 193 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodeTagsAt()

std::vector< std::string > eve::scene::Scene::getNodeTagsAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node tags at.

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

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodeVisibleAt()

bool eve::scene::Scene::getNodeVisibleAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node visible at.

在文件 SceneNodes.cpp 第 201 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodeWorldPositionAt()

std::vector< float > eve::scene::Scene::getNodeWorldPositionAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node world position at.

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

引用了 h, n, nodeId , 以及 resolveHost().

◆ getNodeWorldRotationAt()

std::vector< float > eve::scene::Scene::getNodeWorldRotationAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node world rotation at.

在文件 SceneNodes.cpp 第 216 行定义.

引用了 h, n, nodeId, pos, resolveHost() , 以及 scale.

◆ getNodeWorldScaleAt()

std::vector< float > eve::scene::Scene::getNodeWorldScaleAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

Returns the node world scale at.

在文件 SceneNodes.cpp 第 226 行定义.

引用了 h, n, nodeId, pos, resolveHost() , 以及 scale.

◆ getParentId()

std::string eve::scene::Scene::getParentId ( const std::string &  id)

Returns the parent id.

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

引用了 h, eve::scene::SceneNode::id , 以及 p.

◆ getRootId()

std::string eve::scene::Scene::getRootId ( )

Returns the root id.

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

引用了 h, eve::scene::SceneNode::id , 以及 r.

◆ hasNode()

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

True when node.

在文件 SceneNodes.cpp 第 514 行定义.

引用了 h , 以及 eve::scene::SceneHost::hasNode().

◆ hasNodeBoundsAt()

bool eve::scene::Scene::hasNodeBoundsAt ( const std::string &  hostName,
const std::string &  nodeId 
) const

True when node bounds at.

在文件 SceneNodes.cpp 第 457 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ hasNodeTagAt()

bool eve::scene::Scene::hasNodeTagAt ( const std::string &  hostName,
const std::string &  nodeId,
const std::string &  tag 
) const

True when node tag at.

在文件 SceneNodes.cpp 第 352 行定义.

引用了 h, n, nodeId, resolveHost() , 以及 tag.

◆ isAncestor()

bool eve::scene::Scene::isAncestor ( const std::string &  ancestorId,
const std::string &  nodeId 
)

True when ancestor.

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

引用了 h, eve::scene::SceneHost::isAncestorOfById() , 以及 nodeId.

◆ isDescendant()

bool eve::scene::Scene::isDescendant ( const std::string &  nodeId,
const std::string &  ancestorId 
)

True when descendant.

在文件 SceneNodes.cpp 第 574 行定义.

引用了 h, eve::scene::SceneHost::isDescendantOfById() , 以及 nodeId.

◆ linkAudio3DAt()

bool eve::scene::Scene::linkAudio3DAt ( const std::string &  hostName,
const std::string &  nodeId,
audio::Source *  s 
)

Link audio 3 d at.

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

引用了 h, nodeId, resolveHost(), s , 以及 eve::scene::TransformSystem::updateHost().

◆ linkCamera3DAt()

bool eve::scene::Scene::linkCamera3DAt ( const std::string &  hostName,
const std::string &  nodeId,
graphics::Camera3D *  c 
)

Link camera 3 d at.

在文件 SceneNodes.cpp 第 134 行定义.

引用了 c, h, nodeId, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ linkCountAt()

int eve::scene::Scene::linkCountAt ( const std::string &  hostName,
const std::string &  nodeId 
)

Link count at.

在文件 SceneNodes.cpp 第 168 行定义.

引用了 h, nodeId , 以及 resolveHost().

◆ linkPhysics2DAt()

bool eve::scene::Scene::linkPhysics2DAt ( const std::string &  hostName,
const std::string &  nodeId,
physics::Body *  b,
const std::string &  mode 
)

Link physics 2 d at.

在文件 SceneNodes.cpp 第 116 行定义.

引用了 b, h, nodeId, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ linkPhysics3DAt()

bool eve::scene::Scene::linkPhysics3DAt ( const std::string &  hostName,
const std::string &  nodeId,
physics::Body3D *  b,
const std::string &  mode 
)

Link physics 3 d at.

在文件 SceneNodes.cpp 第 125 行定义.

引用了 b, h, nodeId, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ linkRenderable2D()

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

Links a 2D renderable to a node in the current host.

在文件 SceneNodes.cpp 第 82 行定义.

引用了 currentHostName(), linkRenderable2DAt(), nodeId , 以及 r.

◆ linkRenderable2DAt()

bool eve::scene::Scene::linkRenderable2DAt ( const std::string &  hostName,
const std::string &  nodeId,
graphics::Renderable2D *  r 
)

Link renderable 2 d at.

在文件 SceneNodes.cpp 第 98 行定义.

引用了 h, nodeId, r, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

被这些函数引用 linkRenderable2D().

◆ linkRenderable3D()

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

Links a 3D renderable to a node in the current host.

在文件 SceneNodes.cpp 第 86 行定义.

引用了 currentHostName(), linkRenderable3DAt(), nodeId , 以及 r.

◆ linkRenderable3DAt()

bool eve::scene::Scene::linkRenderable3DAt ( const std::string &  hostName,
const std::string &  nodeId,
graphics::Renderable3D *  r 
)

Link renderable 3 d at.

在文件 SceneNodes.cpp 第 107 行定义.

引用了 h, nodeId, r, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

被这些函数引用 linkRenderable3D().

◆ localToWorldAt()

std::vector< float > eve::scene::Scene::localToWorldAt ( const std::string &  hostName,
const std::string &  nodeId,
float  x,
float  y,
float  z 
) const

Local to world at.

在文件 SceneNodes.cpp 第 236 行定义.

引用了 h, n, nodeId, p, resolveHost(), x, y , 以及 z.

◆ Module_REG()

eve::scene::Scene::Module_REG ( Scene  )

◆ mount()

eve::Result< SceneHost * > eve::scene::Scene::mount ( NodeDesc  root)

Mounts the tree as the default host and selects it.

返回
Borrowed ECS-owned host, or a structured failure.

在文件 Scene.cpp 第 709 行定义.

引用了 h , 以及 visible.

◆ mountAs()

eve::Result< SceneHost * > eve::scene::Scene::mountAs ( const std::string &  name,
NodeDesc  root 
)

Creates/replaces a named host from a NodeDesc tree and selects it.

返回
A borrowed host owned by the ECS scene table, or a structured failure.
备注
The returned pointer remains valid until that host is destroyed; nodes are invalidated by a subsequent tree replacement/reconcile.

在文件 Scene.cpp 第 690 行定义.

◆ mountBuild()

bool eve::scene::Scene::mountBuild ( )

Mounts build.

在文件 Scene.cpp 第 909 行定义.

◆ mountBuildAs()

bool eve::scene::Scene::mountBuildAs ( const std::string &  name)

Mounts build as.

在文件 Scene.cpp 第 918 行定义.

◆ nodeIdFromSpatialIdAt()

std::string eve::scene::Scene::nodeIdFromSpatialIdAt ( const std::string &  hostName,
int  index 
) const

Map a spatial-index id (arena index) back to a node id.

在文件 SceneNodes.cpp 第 508 行定义.

引用了 h, eve::scene::SceneNode::id, index, n , 以及 resolveHost().

◆ pickRayAt()

std::string eve::scene::Scene::pickRayAt ( const std::string &  hostName,
float  ox,
float  oy,
float  oz,
float  dx,
float  dy,
float  dz 
) const

Nearest node id hit by a world ray (nodes with bounds), or "".

在文件 SceneNodes.cpp 第 472 行定义.

引用了 best, dir, dx, dy, dz, h, n, origin, ox, oy, eve::scene::rayAABB(), resolveHost(), w , 以及 eve::scene::worldBoundsOf().

被这些函数引用 pickScreenAt().

◆ pickScreenAt()

std::string eve::scene::Scene::pickScreenAt ( const std::string &  hostName,
graphics::Camera3D *  cam,
float  screenX,
float  screenY,
float  viewW,
float  viewH 
) const

Screen-space picking through a Camera3D (camera.screenToRay).

在文件 SceneCameraQueries.cpp 第 28 行定义.

引用了 pickRayAt().

◆ remount()

eve::Result< SceneHost * > eve::scene::Scene::remount ( NodeDesc  root)

Replaces the selected host's tree.

返回
Borrowed ECS-owned host, or a structured failure.

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

被这些函数引用 serializeHostAt().

◆ remountAs()

eve::Result< SceneHost * > eve::scene::Scene::remountAs ( const std::string &  name,
NodeDesc  root 
)

Creates/replaces a named host through the canonical mount path.

返回
Borrowed ECS-owned host, or a structured failure.

在文件 Scene.cpp 第 752 行定义.

◆ remountBuildAs()

bool eve::scene::Scene::remountBuildAs ( const std::string &  name)

Remount build as.

在文件 Scene.cpp 第 927 行定义.

◆ remountReconcile()

eve::Result< SceneHost * > eve::scene::Scene::remountReconcile ( NodeDesc  root)

Reconciles the selected host, reporting whether replacement failed.

返回
Borrowed ECS-owned host, or a structured failure.

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

◆ removeChildAt()

bool eve::scene::Scene::removeChildAt ( const std::string &  hostName,
const std::string &  parentId,
const std::string &  childId 
)

Removes child at.

在文件 SceneNodes.cpp 第 282 行定义.

引用了 h, ok, parentId, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ removeNodeAt()

bool eve::scene::Scene::removeNodeAt ( const std::string &  hostName,
const std::string &  nodeId 
)

Detach node from its parent (arena node stays; rebuild to delete).

在文件 SceneNodes.cpp 第 265 行定义.

引用了 h, nodeId, ok, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ removeNodeTagAt()

bool eve::scene::Scene::removeNodeTagAt ( const std::string &  hostName,
const std::string &  nodeId,
const std::string &  tag 
)

Removes node tag at.

在文件 SceneNodes.cpp 第 345 行定义.

引用了 h, n, nodeId, resolveHost() , 以及 tag.

◆ resolveHost()

◆ rootEntity()

bool eve::scene::Scene::rootEntity ( const std::string &  hostName,
const std::string &  nodeId,
ssq::Object  instance 
)

Root one script instance on a node (creates SceneObject lazily).

在文件 Scene.cpp 第 998 行定义.

引用了 enabled, h , 以及 top.

◆ scheduleDetachEntityAt()

eve::Result< void > eve::scene::Scene::scheduleDetachEntityAt ( const std::string &  hostName,
const std::string &  nodeId,
ssq::Object  instance 
)

Queue a script instance for detach at the end of the current/next updateScripts.

Safe to call from inside update(dt) / onEnable / onDisable. Immediate detachEntityAt remains available for composition roots outside update.

参数
hostNameHost name; empty uses the selected host.
nodeIdStable node id.
instanceRooted eve.SceneEntity instance to detach.
返回
Applied when queued (or already pending); NotFound / InvalidArgument on miss. @cost O(bindings on the node) to locate the instance; flush is O(queued).

在文件 Scene.cpp 第 1094 行定义.

◆ select()

bool eve::scene::Scene::select ( const std::string &  name)

Selects a named host; false when it does not exist.

在文件 Scene.cpp 第 756 行定义.

◆ serializeHostAt()

std::string eve::scene::Scene::serializeHostAt ( const std::string &  hostName) const

Serialize host at.

在文件 Scene.cpp 第 831 行定义.

引用了 remount().

◆ setBuildPosition()

void eve::scene::Scene::setBuildPosition ( float  x,
float  y,
float  z = 0.f 
)

Sets the build position.

在文件 Scene.cpp 第 882 行定义.

◆ setBuildRotation()

void eve::scene::Scene::setBuildRotation ( float  yaw,
float  pitch = 0.f,
float  roll = 0.f 
)

Sets the build rotation.

在文件 Scene.cpp 第 889 行定义.

◆ setBuildScale()

void eve::scene::Scene::setBuildScale ( float  sx,
float  sy,
float  sz = 1.f 
)

Sets the build scale.

在文件 Scene.cpp 第 896 行定义.

引用了 node.

◆ setBuildSpace()

void eve::scene::Scene::setBuildSpace ( const std::string &  space)

Sets the build space.

在文件 Scene.cpp 第 903 行定义.

◆ setBuildVisible()

void eve::scene::Scene::setBuildVisible ( bool  visible)

Sets the build visible.

在文件 Scene.cpp 第 905 行定义.

引用了 node.

◆ setHostLayer()

void eve::scene::Scene::setHostLayer ( int  layer)

Sets the render layer of every host (or the selected one).

在文件 Scene.cpp 第 791 行定义.

◆ setHostVisible()

void eve::scene::Scene::setHostVisible ( bool  visible)

Shows/hides every host (or the selected one when a host is selected).

在文件 Scene.cpp 第 787 行定义.

◆ setNodeBoundsAt()

bool eve::scene::Scene::setNodeBoundsAt ( const std::string &  hostName,
const std::string &  nodeId,
float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)

Sets the node bounds at.

在文件 SceneNodes.cpp 第 441 行定义.

引用了 h, n, nodeId , 以及 resolveHost().

◆ setNodeEventHandlerAt()

bool eve::scene::Scene::setNodeEventHandlerAt ( const std::string &  hostName,
ssq::Object  cb 
)

Register a script callback for node lifecycle events on a host: The callback receives action, nodeId and parentId; action is one of {"node_added","node_removed","node_moved","node_changed"}. Pass null cb to clear. Rooted for the process lifetime.

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

引用了 action, h, name, nodeId, parentId , 以及 resolveHost().

◆ setNodeLayerAt()

bool eve::scene::Scene::setNodeLayerAt ( const std::string &  hostName,
const std::string &  nodeId,
int  layer 
)

Sets the node layer at.

在文件 SceneNodes.cpp 第 378 行定义.

引用了 h, layer, n, nodeId , 以及 resolveHost().

◆ setNodeLookAtAt()

bool eve::scene::Scene::setNodeLookAtAt ( const std::string &  hostName,
const std::string &  nodeId,
float  tx,
float  ty,
float  tz 
)

Orient node so its local +Z axis points at (tx,ty,tz).

在文件 SceneNodes.cpp 第 314 行定义.

引用了 f, h, n, nodeId, pos, q, resolveHost(), right, target , 以及 up.

◆ setNodeParentAt()

bool eve::scene::Scene::setNodeParentAt ( const std::string &  hostName,
const std::string &  childId,
const std::string &  parentId 
)

Reparent by id; empty parentId detaches. Cycle-safe.

在文件 SceneNodes.cpp 第 256 行定义.

引用了 h, ok, parentId, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ setNodePosition()

bool eve::scene::Scene::setNodePosition ( const std::string &  id,
float  x,
float  y,
float  z 
)

Script-friendly TRS setters on the current host; each marks the transform dirty.

在文件 SceneNodes.cpp 第 36 行定义.

引用了 h, n, x, y , 以及 z.

◆ setNodeQuaternionAt()

bool eve::scene::Scene::setNodeQuaternionAt ( const std::string &  hostName,
const std::string &  nodeId,
float  qx,
float  qy,
float  qz,
float  qw 
)

Sets the node quaternion at.

在文件 SceneNodes.cpp 第 291 行定义.

引用了 h, n, nodeId, q, qw, qx, qy, qz , 以及 resolveHost().

◆ setNodeRotation()

bool eve::scene::Scene::setNodeRotation ( const std::string &  id,
float  yaw,
float  pitch,
float  roll 
)

Sets the local rotation (yaw/pitch/roll in degrees) of a node.

在文件 SceneNodes.cpp 第 48 行定义.

引用了 h, n, pitch, roll , 以及 yaw.

◆ setNodeScale()

bool eve::scene::Scene::setNodeScale ( const std::string &  id,
float  sx,
float  sy,
float  sz 
)

Sets the local scale of a node.

在文件 SceneNodes.cpp 第 60 行定义.

引用了 h, n, sx, sy , 以及 sz.

◆ setNodeVisible()

bool eve::scene::Scene::setNodeVisible ( const std::string &  id,
bool  visible 
)

Shows/hides a node.

在文件 SceneNodes.cpp 第 72 行定义.

引用了 h, n , 以及 visible.

◆ syncSpatialIndexAt()

bool eve::scene::Scene::syncSpatialIndexAt ( const std::string &  hostName,
spatial::Octree *  ot 
) const

Insert every bounded node's world AABB into an octree (id = arena index).

在文件 SceneNodes.cpp 第 495 行定义.

引用了 h, index, eve::spatial::Octree::insert(), n, resolveHost(), w , 以及 eve::scene::worldBoundsOf().

◆ unlinkNode()

bool eve::scene::Scene::unlinkNode ( const std::string &  nodeId)

Removes every link on a node in the current host.

在文件 SceneNodes.cpp 第 90 行定义.

引用了 currentHostName(), nodeId , 以及 unlinkNodeAt().

◆ unlinkNodeAt()

bool eve::scene::Scene::unlinkNodeAt ( const std::string &  hostName,
const std::string &  nodeId 
)

Remove every link on the node.

在文件 SceneNodes.cpp 第 152 行定义.

引用了 h, nodeId , 以及 resolveHost().

被这些函数引用 unlinkNode().

◆ unlinkNodeKindAt()

bool eve::scene::Scene::unlinkNodeKindAt ( const std::string &  hostName,
const std::string &  nodeId,
const std::string &  kind 
)

Remove links of one kind ("renderable2d"|"renderable3d"|"physics2d"|...).

在文件 SceneNodes.cpp 第 157 行定义.

引用了 h, kind, nodeId, removed, resolveHost() , 以及 eve::scene::TransformSystem::updateHost().

◆ unrootEntityAt()

bool eve::scene::Scene::unrootEntityAt ( const std::string &  hostName,
const std::string &  nodeId,
int  index 
)

Remove a rooted script instance by its index in the binding list.

在文件 Scene.cpp 第 1018 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), h, eve::InvalidArgument, n, nodeId, eve::NotFound, eve::PreconditionViolation , 以及 resolveHost().

◆ updateScripts()

void eve::scene::Scene::updateScripts ( float  dt)

updateTransformsAll() + call update(dt) on every rooted instance.

在文件 Scene.cpp 第 1062 行定义.

◆ updateTransforms()

void eve::scene::Scene::updateTransforms ( )

Propagate transforms (+ link sync) for all hosts (or current if selected).

在文件 Scene.cpp 第 795 行定义.

◆ updateTransformsAll()

void eve::scene::Scene::updateTransformsAll ( )

Propagate transforms for every host regardless of selection.

在文件 Scene.cpp 第 800 行定义.

引用了 eve::scene::NodeDesc::children, name , 以及 node.

◆ walkBreadthFirstIds()

std::vector< std::string > eve::scene::Scene::walkBreadthFirstIds ( )

Walk breadth first ids.

在文件 SceneNodes.cpp 第 607 行定义.

引用了 h, n , 以及 eve::scene::SceneHost::walkBreadthFirst().

◆ walkDepthFirstIds()

std::vector< std::string > eve::scene::Scene::walkDepthFirstIds ( )

DFS order of ids under root (same as collectIds). Kept for script naming clarity.

在文件 SceneNodes.cpp 第 605 行定义.

引用了 collectIds().

◆ worldToLocalAt()

std::vector< float > eve::scene::Scene::worldToLocalAt ( const std::string &  hostName,
const std::string &  nodeId,
float  x,
float  y,
float  z 
) const

World to local at.

在文件 SceneNodes.cpp 第 246 行定义.

引用了 h, n, nodeId, p, resolveHost(), x, y , 以及 z.


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