Returns number of direct children attached to parent entity.
Takes parentEntity (parent entity handle).
Returns count as Int (number of children, 0 if no children or invalid entity).
3D Graphics
Parameters & Returns
Parameters
parentEntityInt
Returns
Int
Quick Summary
Returns number of direct children attached to parent entity.
Takes parentEntity (parent entity handle).
Returns count as Int (number of children, 0 if no children or invalid entity).
Technical Exegesis...
Returns number of direct children attached to parent entity. Takes parentEntity (parent entity handle). Returns count as Int (number of children, 0 if no children or invalid entity). Validates parent exists, returns size of parent.children vector (direct children count), returns 0 if entity doesn't exist or has no children. Query function for hierarchy traversal.
This function queries direct child count.
Returns number of direct children attached to parent entity. Takes parentEntity (parent entity handle). Returns count as Int (number of children, 0 if no children or invalid entity). Validates parent exists, returns size of parent.children vector (direct children count), returns 0 if entity doesn't exist or has no children. Query function for hierarchy traversal.
This function queries direct child count. Direct children: only counts immediate children (first level in hierarchy, not grandchildren or deeper descendants), parent.children vector contains pointers to directly-attached entities (entities with parent=this entity). Return values: returns child count (0 or positive integer), 0 if entity has no children (children vector empty), 0 if entity handle invalid (entity doesn't exist). Use cases: (1) Hierarchy traversal (iterate through children with b3dGetChild), (2) Validation (check if entity has children before operations), (3) Debugging (inspect scene graph structure), (4) Dynamic hierarchy (determine if entity is leaf or branch node), (5) Save/load systems (serialize hierarchy relationships). Common pattern: count = b3dGetChildCount(parent), for i=0 to count-1: child = b3dGetChild(parent, i), process child, traverse hierarchy recursively. Typical usage: check child count before iteration, validate hierarchy structure, implement scene graph visitors. Hierarchy depth: only counts direct children (one level), for total descendant count: recursively count children of children: totalDescendants = b3dGetChildCount(entity), for each child: totalDescendants += CountAllDescendants(child). Leaf vs branch nodes: leaf nodes have childCount=0 (no children, terminal entities like meshes/lights), branch nodes have childCount>0 (pivots, scene organization nodes). Performance: O(1) operation (returns vector.size(), hash map find, fast query). Empty parent: entities with no children (most leaf entities like meshes/cameras) return 0. Children management: children added via b3dSetParent, removed when detached or deleted, count updates automatically. Related: b3dGetChild retrieves child by index, b3dSetParent establishes parent-child relationships, b3dFindChild searches children by name, entity hierarchy system for grouped transforms.