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_sharpness: OceanWakeSharpness
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.

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_wake_properties()

Set wake properties based on the cached enum values.

This function adjusts various aspects of the wake simulation using the cached wake property values.

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 | 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.

restore_wake_target() None

Restore the wake target to the previously stored asset.

This function calls set_wake_properties to apply the cached wake property values and sets the ocean target based on the stored asset.

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_sharpness(wake_sharpness: OceanWakeSharpness) None

Set the wake sharpness and update wake properties.

Parameters:

wake_sharpness (OceanWakeSharpness) – The wake sharpness to set.