The world hierarchy¶
The world has a tree structure maintaining spatial relationships between objects called
Nodes
. Some Nodes exist in the world by default, and others can be
created through BBI in notebooks.
Tip: View the world tree
Use world.show()
to visualize the world tree in the notebook. This is useful for debugging
and understanding the hierarchical relationships between objects.
Examples of Nodes
Most commonly used classes are in fact Nodes, including:
What do nodes do?¶
As part of the world tree, Nodes are unique, exist in 3D space, and can have children. This is why all Nodes have:
node_id
, a unique string identifierA
Transform
that defines their position, rotation, and scaleA reference to a parent Node, and a
list
of children Nodes
What happens when Nodes have the same node_id
?¶
Different Nodes can be created with the same node_id
. However, when they’re added to the world,
the last added Node will replace any existing ones with the same ID.
- add(self, node: Node) None
Adds a node to the world.
Use this method to add new
Asset
andSpawnZone
objects in the world. Existing nodes with the same node_id will be deleted and replaced with the incoming node. All existing parent-child relationships will be lost.- Parameters:
node (Node) – The node to add to the World.