Returns child entity handle at specified index (0-based array access).
Takes parentEntity (parent entity handle), index (child index 0 to childCount-1).
Returns child handle as Int (entity handle of child, 0 if invalid).
3D Graphics
Parameters & Returns
Parameters
parentEntityInt
indexInt
Returns
Int
Quick Summary
Returns child entity handle at specified index (0-based array access).
Takes parentEntity (parent entity handle), index (child index 0 to childCount-1).
Returns child handle as Int (entity handle of child, 0 if invalid).
Technical Exegesis...
Returns child entity handle at specified index (0-based array access). Takes parentEntity (parent entity handle), index (child index 0 to childCount-1). Returns child handle as Int (entity handle of child, 0 if invalid). Validates parent exists, checks index bounds (0 <= index < children.size()), returns children[index]->handle (child entity's handle), returns 0 if parent invalid or index out of bounds. Array-style access to children list.
This function retrieves child by index.
Returns child entity handle at specified index (0-based array access). Takes parentEntity (parent entity handle), index (child index 0 to childCount-1). Returns child handle as Int (entity handle of child, 0 if invalid). Validates parent exists, checks index bounds (0 <= index < children.size()), returns children[index]->handle (child entity's handle), returns 0 if parent invalid or index out of bounds. Array-style access to children list.
This function retrieves child by index. Indexing: children stored in vector (parent.children), 0-based indexing (first child index=0, last child index=childCount-1), index order matches insertion order (order children were parented via b3dSetParent). Bounds checking: validates index >= 0 AND index < children.size(), returns 0 if index out of bounds (negative or >= childCount), safe access (no crashes on invalid index). Return values: returns child entity handle (integer, same type used in other entity functions), returns 0 if invalid parent, invalid index, or no children. Use cases: (1) Hierarchy iteration (loop through all children), (2) Selective child access (get specific child by position), (3) Scene graph traversal (depth-first or breadth-first), (4) Debugging (inspect hierarchy structure), (5) Save/load systems (serialize children in order). Common pattern: count = b3dGetChildCount(parent), for i=0 to count-1: child = b3dGetChild(parent, i), process child (query, transform, recurse). Typical usage: iterate all children for batch operations, or access specific child by known index, combine with b3dGetChildCount for loop bounds. Hierarchy traversal: recursive pattern for depth-first: ProcessEntity(entity): count = b3dGetChildCount(entity), for i=0 to count-1: child = b3dGetChild(entity, i), ProcessEntity(child) (recurses into subtree). Order stability: children maintain insertion order (order they were parented), reparenting may change order (removed from old parent list, added to new parent list). Performance: O(1) operation (vector indexing, hash map find, fast random access). Child removal: if child detached (b3dSetParent(child, 0)), removed from children vector (indices shift down, affects iteration if modifying during loop). Related: b3dGetChildCount returns child count for loop bounds, b3dSetParent adds children to list, b3dFindChild searches children by name, b3dGetParent gets parent of entity.