bbi.world

class BaseWorld(world_name: str)

Bases: ABC

Represents the 3D world being loaded into the scene.

property env: Environment

The environment in the world.

property camera: BaseCamera

The default camera in the world.

has_ocean() bool

Checks if the world has an ocean.

Returns:

True if the world has an ocean, False otherwise.

Return type:

bool

list_node_ids() list[str]

Retrieves a list of unique node IDs of added nodes in the world.

Returns:

The list of node IDs.

Return type:

list[str]

get(node_id: str) Node

Retrieves a node from the world by its unique id.

Parameters:

node_id (str) – The ID of the node.

get_points() list[Point]

Retrieves the points from the scene data.

Returns:

List of points in the world.

Return type:

list[Point]

get_splines() list[Spline]

Retrieves the splines from the scene data.

Returns:

List of splines in the world.

Return type:

list[Spline]

get_cuboids() list[Cuboid]

Retrieves the cuboids from the scene data.

Returns:

List of cuboids in the world.

Return type:

list[Cuboid]

new_scenario(num_frames: int, total_seconds: float = 0.0) Scenario

Creates a new scenario. Note that creating a new scenario will clear all previously set keyframes.

Parameters:
  • num_frames (int) – The number of frames in the scenario.

  • total_seconds (float) – The expected total duration of this scenario in seconds. This is used together with num_frames to calculate the delta time between frames. For example, if num_frames is 100 and total_seconds is 10, then the delta time between frames is 0.1 seconds. Set it to 0.0 to disable delta time calculation.

Returns:

A new scenario.

Return type:

Scenario

add(node: Node) None

Adds a node to the world.

Use this method to add new Asset and SpawnZone 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.

remove(node: Node) None

Removes a node from the world.

Parameters:

node (Node) – The node to remove from the world.

show() None

Displays the world hierarchy in a human-readable format.

class World(world_name: str)

Bases: BaseWorld

property camera: Camera

The default camera in the world.

class SatelliteWorld

Bases: BaseWorld

property camera: SatelliteCamera

The default camera in the world.

property backplate: SatelliteBackplate

The backplate in the world.