bbi.environment.ocean

pydantic model OceanUpdateParam

Bases: AnimationFrame

field sea_color: SeaColor | None = None
field sea_state: SeaState | None = None
class Ocean(sea_state: SeaState, sea_color: SeaColor)

Bases: Node, Animatable[OceanUpdateParam]

Class for controlling the ocean state.

The World has a default ocean accessible via world.env.ocean. Only available for worlds with an ocean.

Parameters:
  • sea_state (SeaState) – The state of the ocean.

  • sea_color (SeaColor) – The color of the ocean.

property sea_state: SeaState
property sea_color: SeaColor
property wake_duration: OceanWakeDuration
execute(frame_id: int | None = None, frame_max: int | None = None, delta_seconds: float | None = None) None

Updates the ocean state to the specified frame.

Parameters:
  • frame_id (int | None, optional) – The frame ID. Defaults to None.

  • frame_max (int | None, optional) – Max frame count in the current loop. Defaults to None.

  • delta_seconds (float | None, optional) – The target real-time in seconds between frames. This is used to calculate physical displacement for certain assets. Defaults to None.

set_sea_state(state: SeaState) None

Set the state of the ocean.

Parameters:

state (SeaState) – The state of the ocean to update to.

set_sea_color(color: SeaColor) None

Set the color of the ocean.

Parameters:

color (SeaColor) – The color of the ocean to update to.

set_wake_properties(wake_height: OceanWakeHeight | None = None, wake_length: OceanWakeLength | None = None, foam_intensity: OceanFoamIntensity | None = None, churn_strength: OceanChurnStrength | None = None, wake_sharpness: OceanWakeSharpness | None = None, speed_modifier: OceanWakeSpeed | None = None, sea_state_modifier: SeaState | None = None)

Set wake properties based on the provided enum values.

This function adjusts various aspects of the wake simulation. Each parameter is optional, allowing for fine-tuned control over specific wake characteristics.

Parameters:
  • wake_height (WakeHeight | None, optional) – Controls the overall height of the wakes.

  • wake_length (WakeLength | None, optional) – Determines the length and persistence of the wakes.

  • foam_intensity (FoamIntensity | None, optional) – Sets the intensity of foam generation in the wake.

  • churn_strength (ChurnStrength | None, optional) – Controls the turbulence and churn in the wake.

  • wake_sharpness (WakeSharpness | None, optional) – Determines the detail and definition of the wake.

  • speed_modifier (WakeSpeed | None, optional) – Adjusts wake properties based on vessel speed.

  • sea_state_modifier (SeaState | None, optional) – Overrides the current sea state for wake calculations.

Note

The function takes into account the speed modifier and sea state (or sea state modifier if provided) and applies modifiers accordingly. Rougher seas or higher speeds will intensify certain wake properties, while calmer conditions or lower speeds may reduce them.

set_wake_duration(duration: OceanWakeDuration) None

Set the wake duration using OceanWakeDuration enum.

Parameters:

duration (OceanWakeDuration) – The wake duration preset to apply.

set_global_wake_target(asset: Asset, speed: OceanWakeSpeed | None = None, sea_state: SeaState | None = None) None

Set the asset to fine tune ocean parameters for

Parameters:
  • asset (Asset) – The asset to set the target of the ocean

  • speed (OceanWakeSpeed | None, optional) – The speed modifier for wake effects. Defaults to MODERATE if not specified.

  • sea_state (SeaState | None, optional) – Override the current sea state for wake calculations. If not specified, uses the ocean’s current sea state.