Declarative scene module (eve.Scene). 更多...
#include <Scene.h>
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()
| eve::scene::Scene::Scene | ( | ) |
◆ ~Scene()
|
override |
成员函数说明
◆ 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 = "" |
||
| ) |
◆ addNodeTagAt()
| bool eve::scene::Scene::addNodeTagAt | ( | const std::string & | hostName, |
| const std::string & | nodeId, | ||
| const std::string & | 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.
- 参数
-
hostName Scene host to mutate. cam Borrowed camera used only during this call. viewW Positive viewport width. viewH Positive viewport height. tag Terrain classification tag, such as terrainormesh-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 | ( | ) |
◆ beginGroup()
| void eve::scene::Scene::beginGroup | ( | const std::string & | id = "" | ) |
◆ beginNode()
| void eve::scene::Scene::beginNode | ( | const std::string & | id, |
| const std::string & | name = "" |
||
| ) |
◆ bindOwner()
| void eve::scene::Scene::bindOwner | ( | uint32_t | ownerId | ) |
Binds the selected host to a UI/scene owner id.
引用了 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 |
◆ collectIdsFrom()
| std::vector< std::string > eve::scene::Scene::collectIdsFrom | ( | const std::string & | id | ) |
◆ collectIdsVisible()
| std::vector< std::string > eve::scene::Scene::collectIdsVisible | ( | bool | visible | ) |
Collect ids visible.
在文件 SceneNodes.cpp 第 595 行定义.
引用了 eve::scene::SceneHost::collectIdsVisible(), h , 以及 visible.
◆ current()
|
inlinenoexcept |
◆ currentHostName()
| std::string eve::scene::Scene::currentHostName | ( | ) | const |
Current host name.
被这些函数引用 linkRenderable2D(), linkRenderable3D() , 以及 unlinkNode().
◆ deserializeHostAt()
| bool eve::scene::Scene::deserializeHostAt | ( | const std::string & | hostName, |
| const std::string & | json | ||
| ) |
◆ end()
◆ findHost()
| eve::Result< SceneHost * > eve::scene::Scene::findHost | ( | const std::string & | name | ) | const |
◆ findHostByOwner()
| eve::Result< SceneHost * > eve::scene::Scene::findHostByOwner | ( | uint32_t | ownerId | ) | const |
◆ findIdByName()
| std::string eve::scene::Scene::findIdByName | ( | const std::string & | name | ) |
◆ findIdByPath()
| std::string eve::scene::Scene::findIdByPath | ( | const std::string & | path | ) |
◆ flushDelayedDetaches()
| void eve::scene::Scene::flushDelayedDetaches | ( | ) |
◆ forEachEntity()
| int eve::scene::Scene::forEachEntity | ( | const std::string & | hostName, |
| const std::string & | nodeId, | ||
| ssq::Object | cb | ||
| ) |
◆ 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 |
◆ 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 |
◆ 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 |
◆ 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 |
◆ getNodeRefByPathAt()
| SceneNodeRef * eve::scene::Scene::getNodeRefByPathAt | ( | const std::string & | hostName, |
| const std::string & | path | ||
| ) | const |
◆ getNodeRotationAt()
| std::vector< float > eve::scene::Scene::getNodeRotationAt | ( | const std::string & | hostName, |
| const std::string & | nodeId | ||
| ) | const |
◆ getNodeScaleAt()
| std::vector< float > eve::scene::Scene::getNodeScaleAt | ( | const std::string & | hostName, |
| const std::string & | nodeId | ||
| ) | const |
◆ getNodeTagsAt()
| std::vector< std::string > eve::scene::Scene::getNodeTagsAt | ( | const std::string & | hostName, |
| const std::string & | nodeId | ||
| ) | const |
◆ getNodeVisibleAt()
| bool eve::scene::Scene::getNodeVisibleAt | ( | const std::string & | hostName, |
| const std::string & | nodeId | ||
| ) | const |
◆ 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 行定义.
◆ 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 行定义.
◆ getParentId()
| std::string eve::scene::Scene::getParentId | ( | const std::string & | id | ) |
◆ getRootId()
| std::string eve::scene::Scene::getRootId | ( | ) |
◆ hasNode()
| bool eve::scene::Scene::hasNode | ( | const std::string & | id | ) |
◆ hasNodeBoundsAt()
| bool eve::scene::Scene::hasNodeBoundsAt | ( | const std::string & | hostName, |
| const std::string & | nodeId | ||
| ) | const |
◆ hasNodeTagAt()
| bool eve::scene::Scene::hasNodeTagAt | ( | const std::string & | hostName, |
| const std::string & | nodeId, | ||
| const std::string & | tag | ||
| ) | const |
◆ 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 | ||
| ) |
◆ 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 |
◆ Module_REG()
| eve::scene::Scene::Module_REG | ( | Scene | ) |
◆ mount()
| eve::Result< SceneHost * > eve::scene::Scene::mount | ( | NodeDesc | root | ) |
◆ mountAs()
| eve::Result< SceneHost * > eve::scene::Scene::mountAs | ( | const std::string & | name, |
| NodeDesc | root | ||
| ) |
◆ mountBuild()
◆ mountBuildAs()
| bool eve::scene::Scene::mountBuildAs | ( | const std::string & | name | ) |
◆ 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.
被这些函数引用 serializeHostAt().
◆ remountAs()
| eve::Result< SceneHost * > eve::scene::Scene::remountAs | ( | const std::string & | name, |
| NodeDesc | root | ||
| ) |
◆ remountBuildAs()
| bool eve::scene::Scene::remountBuildAs | ( | const std::string & | name | ) |
◆ remountReconcile()
| eve::Result< SceneHost * > eve::scene::Scene::remountReconcile | ( | NodeDesc | root | ) |
◆ 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 | ||
| ) |
◆ resolveHost()
| SceneHost * eve::scene::Scene::resolveHost | ( | const std::string & | hostName | ) | const |
Host-qualified resolution: empty hostName → currently selected host.
被这些函数引用 addChildAt(), addNodeTagAt(), applyPcgTerrainCullingAt(), collectFrustumIdsAt(), collectIdsByTagAt(), getNodeBoundsAt(), getNodeLayerAt(), getNodePositionAt(), getNodeQuaternionAt(), getNodeRotationAt(), getNodeScaleAt(), getNodeTagsAt(), getNodeVisibleAt(), getNodeWorldPositionAt(), getNodeWorldRotationAt(), getNodeWorldScaleAt(), hasNodeBoundsAt(), hasNodeTagAt(), linkAudio3DAt(), linkCamera3DAt(), linkCountAt(), linkPhysics2DAt(), linkPhysics3DAt(), linkRenderable2DAt(), linkRenderable3DAt(), localToWorldAt(), nodeIdFromSpatialIdAt(), pickRayAt(), removeChildAt(), removeNodeAt(), removeNodeTagAt(), setNodeBoundsAt(), setNodeEventHandlerAt(), setNodeLayerAt(), setNodeLookAtAt(), setNodeParentAt(), setNodeQuaternionAt(), syncSpatialIndexAt(), unlinkNodeAt(), unlinkNodeKindAt(), unrootEntityAt() , 以及 worldToLocalAt().
◆ rootEntity()
| bool eve::scene::Scene::rootEntity | ( | const std::string & | hostName, |
| const std::string & | nodeId, | ||
| ssq::Object | instance | ||
| ) |
◆ 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.
- 参数
-
hostName Host name; empty uses the selected host. nodeId Stable node id. instance Rooted eve.SceneEntityinstance 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).
◆ select()
| bool eve::scene::Scene::select | ( | const std::string & | name | ) |
◆ serializeHostAt()
| std::string eve::scene::Scene::serializeHostAt | ( | const std::string & | hostName | ) | const |
◆ setBuildPosition()
| void eve::scene::Scene::setBuildPosition | ( | float | x, |
| float | y, | ||
| float | z = 0.f |
||
| ) |
◆ setBuildRotation()
◆ setBuildScale()
| void eve::scene::Scene::setBuildScale | ( | float | sx, |
| float | sy, | ||
| float | sz = 1.f |
||
| ) |
◆ setBuildSpace()
| void eve::scene::Scene::setBuildSpace | ( | const std::string & | space | ) |
◆ setBuildVisible()
| void eve::scene::Scene::setBuildVisible | ( | bool | visible | ) |
◆ setHostLayer()
| void eve::scene::Scene::setHostLayer | ( | int | layer | ) |
◆ setHostVisible()
| void eve::scene::Scene::setHostVisible | ( | bool | visible | ) |
◆ 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 | ||
| ) |
◆ 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 行定义.
◆ setNodeLayerAt()
| bool eve::scene::Scene::setNodeLayerAt | ( | const std::string & | hostName, |
| const std::string & | nodeId, | ||
| int | layer | ||
| ) |
◆ setNodeLookAtAt()
| bool eve::scene::Scene::setNodeLookAtAt | ( | const std::string & | hostName, |
| const std::string & | nodeId, | ||
| float | tx, | ||
| float | ty, | ||
| float | tz | ||
| ) |
◆ 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 | ||
| ) |
◆ setNodeQuaternionAt()
| bool eve::scene::Scene::setNodeQuaternionAt | ( | const std::string & | hostName, |
| const std::string & | nodeId, | ||
| float | qx, | ||
| float | qy, | ||
| float | qz, | ||
| float | qw | ||
| ) |
◆ setNodeRotation()
| bool eve::scene::Scene::setNodeRotation | ( | const std::string & | id, |
| float | yaw, | ||
| float | pitch, | ||
| float | roll | ||
| ) |
◆ setNodeScale()
| bool eve::scene::Scene::setNodeScale | ( | const std::string & | id, |
| float | sx, | ||
| float | sy, | ||
| float | sz | ||
| ) |
◆ setNodeVisible()
| bool eve::scene::Scene::setNodeVisible | ( | const std::string & | id, |
| bool | 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.
引用了 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.
◆ updateTransforms()
| void eve::scene::Scene::updateTransforms | ( | ) |
◆ updateTransformsAll()
| void eve::scene::Scene::updateTransformsAll | ( | ) |
Propagate transforms for every host regardless of selection.
引用了 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 |
该类的文档由以下文件生成:
- src/modules/scene/Scene.h
- src/modules/scene/Scene.cpp
- src/modules/scene/SceneCameraQueries.cpp
- src/modules/scene/SceneNodes.cpp
Public 成员函数 继承自