API Reference · Scene and camera
Node
public class NodeA node in the scene graph: a transform, and children that inherit it.
Nodes are owned by the UI thread. Every mutation bumps the owning Scene's version, which is how the renderer — running on the render thread — learns that its snapshot is stale. That is the whole threading contract: mutate freely on the UI thread, never touch a node from anywhere else.
Properties
| Member | Description |
|---|---|
| This node's extent plus every descendant's, in its parent's coordinate space. |
| Child nodes. Adding one attaches it to this node's scene. |
| Every node beneath this one, depth first, children in the order they were added. Not this node. Lazy, so a search that stops early stops walking. |
| What a glTF file's |
| Whether this node and its children are drawn. |
| Local-space extent of this node alone, ignoring children. Empty unless overridden. |
| The node's transform. Assigning it overrides position/rotation/scale wholesale, which is what a glTF node wants — those arrive as a matrix, and decomposing and recomposing only loses precision. Setting any of the three components afterwards takes control back. |
| Optional name, for debugging and for identifying a picked node. |
| The node this one hangs from, or null for a root. |
| Translation relative to the parent. |
| Which pass this node is drawn in. Lower draws first; zero is the default and negatives are allowed. It overrides everything else about ordering, which is the point: a sky sphere at −10 is behind the scene however far away it actually is, and an additive shell at +1 is in front of the body it wraps however their origins compare. Within one value the renderers draw all opaque geometry first, then blended geometry back to front by the distance from the camera to each node's origin. Nodes that set nothing all share order 0 and keep the order they were added in. |
| Rotation relative to the parent. See |
| The rotation as yaw (Y), pitch (X) and roll (Z) in degrees. Converts both ways, so reading it after setting |
| Scale relative to the parent. Uniform scale is cheapest; the renderers do not build an inverse transpose for normals. |
| The scene this node belongs to, or null while it is detached. |
| This node's extent plus every descendant's, in world space — |
| Where this node's origin sits in world space. Assigning it sets When an ancestor scales to zero the parent transform cannot be inverted and the assignment is ignored: every local position maps to the same world point, so there is no answer to give. |
|
Walks up to the root on each read rather than caching, because a cache would have to be invalidated by every ancestor's every move and the graphs a viewer control draws are shallow. The one case where that is the wrong trade is reading it for every node in the graph every frame, and the renderer does not — it accumulates downward as it walks, which is what |
Methods
| Member | Description |
|---|---|
| The first descendant whose This node's own name is not considered. A search that can return the thing you searched from is a search every caller has to guard, and the loaders that make names worth searching give the root one too. |
| The first descendant of type A node whose name matches but whose type does not is skipped rather than ending the search, because a glTF file that gives a group and the mesh inside it the same name is common and should not defeat |
| Turns this node so its nose — −Z, as
Aiming at the node's own position does nothing rather than snapping to identity — there is no direction in it, and leaving the last good attitude alone is what a tracker that briefly overflies its target wants. A node holding an explicit |
| Every mesh beneath this node whose world bounds meet The broadphase, and it is here because the renderer needed it anyway. Frustum culling asks exactly this question against six planes rather than a box, and picking asks it against a ray — so the walk existed three times over before it existed once. It is on this list because both consumers wrote a fourth: the demo keeps every solid surface as "the box the renderer already computed for culling" and EliteQuest walks its wall list the same way, both to stop somebody walking through a wall. What this is not. Collision. There is no sweep here, no normal, no penetration depth and no response — those are a physics engine's job and this library is not one. This answers "what is near enough to be worth looking at properly", which is the half that needs the scene graph, and leaves the half that needs a simulation to whoever is running one. Results are appended to
returns How many were found, which is also |
| Every mesh beneath this node whose world bounds the ray enters, nearest first, with how far along the ray each was met. The rejection half of picking, exposed so that a caller can do the other half itself — a game that wants the nearest wall, or the three things under the cursor rather than the one. The distance is to the bounding box, not to the surface. A caller wanting the surface has to intersect the geometry, which is the expensive half and is why this one is separate.
returns How many were found. |