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
property wake_height: OceanWakeHeight
property wake_length: OceanWakeLength
property foam_intensity: OceanFoamIntensity
property churn_strength: OceanChurnStrength
property wake_detail: OceanWakeDetail
property wake_quality: OceanWakeQuality
property wake_range: OceanWakeRange
property white_cap_power: OceanWhiteCapPower
property foam_whitecaps_power: float
property foam_decay: float
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_foam_whitecaps_power(power: float | None) None

Set the foam whitecaps power of the ocean. Set to None to use the default value for the sea state.

This function controls the intensity of white caps (foam) on the ocean surface.

Parameters:

power (float) – The power of the foam white caps. Example range: [0.0 - 10.0] - 0.0: No white cap intensity. - 10.0: Maximum white cap intensity.

set_foam_decay(decay: float | None) None

Set the foam decay of the ocean. Set to None to use the default value for the sea state.

This function controls how quickly foam dissipates over time.

Parameters:

decay (float | None) – The decay rate of the foam. If None, use the default value for the sea state. Example range: [0.0 - 20.0] - 0.0: No decay, foam persists indefinitely. - 20.0: Maximum decay, foam disappears quickly.

enable_dynamic_wakes(enable: bool) None

Enable or disable dynamic wakes for the ocean.

This function controls whether dynamic wake simulation is enabled.

Parameters:

enable (bool) – Whether to enable dynamic wakes.

set_global_wake_target(asset: Asset | None = None) None

Set the asset to fine tune ocean parameters for

Parameters:

asset (Asset | None) – The asset to set the target of the ocean. If None, set it to camera.

set_wake_height(wake_height: OceanWakeHeight) None

Set the wake height and update wake properties.

Parameters:

wake_height (OceanWakeHeight) – The wake height to set.

set_wake_length(wake_length: OceanWakeLength) None

Set the wake length and update wake properties.

Parameters:

wake_length (OceanWakeLength) – The wake length to set.

set_foam_intensity(foam_intensity: OceanFoamIntensity) None

Set the foam intensity and update wake properties.

Parameters:

foam_intensity (OceanFoamIntensity) – The foam intensity to set.

set_churn_strength(churn_strength: OceanChurnStrength) None

Set the churn strength and update wake properties.

Parameters:

churn_strength (OceanChurnStrength) – The churn strength to set.

set_wake_detail(wake_detail: OceanWakeDetail) None

Set the wake detail and update wake properties.

Parameters:

wake_detail (OceanWakeDetail) – The wake detail to set.

set_wake_quality(wake_quality: OceanWakeQuality) None

Set the wake quality and update wake properties.

Parameters:

wake_quality (OceanWakeQuality) – The wake quality to set.

set_wake_range(wake_range: OceanWakeRange) None

Set the wake range and update wake properties.

Parameters:

wake_range (OceanWakeRange) – The wake range to set.

set_wake_duration(duration: OceanWakeDuration) None

Set the wake duration using OceanWakeDuration enum.

Parameters:

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

execute(frame_id: int, frame_max: int, delta_seconds: float) None

Updates the ocean state to the specified frame.

Parameters:
  • frame_id (int) – The frame ID.

  • frame_max (int) – Max frame count in the current loop.

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