Class FogModel.Builder

java.lang.Object
com.luciad.maps.effects.FogModel.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
FogModel

public static final class FogModel.Builder extends Object implements AutoCloseable
Since:
2026.1
  • Constructor Details

    • Builder

      public Builder(@NotNull FogModel.Builder other)
      Copy constructor.
      Parameters:
      other - the builder to copy.
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • fogColor

      @NotNull public FogModel.Builder fogColor(@NotNull android.graphics.Color color)
      Sets the base color of the fog.

      The default is a light sky blue.

      Parameters:
      color - the base color of the fog.
      Returns:
      this builder.
    • lightColor

      @NotNull public FogModel.Builder lightColor(@Nullable android.graphics.Color color)
      Sets the color the fog takes on when looking toward the scene light (a sun-glow tint).

      This is only visible when a light is configured through GraphicsEffects#getLight. The default is an explicit warm white. Pass null instead to make the tint follow the scene light, taking the light's own (diffuse) color so the glow tracks the light.

      Parameters:
      color - the light color of the fog, or null to derive it from the scene light.
      Returns:
      this builder.
    • visibility

      @NotNull public FogModel.Builder visibility(double visibility) throws IllegalArgumentException
      Sets the visibility distance in meters: roughly the distance at which the fog fully obscures the scene at low altitude.

      Smaller values produce thicker fog.

      When a halving height is set, the fog thins with altitude, so this visibility applies near the ground and increases higher up. The default is 80000.

      Parameters:
      visibility - the visibility distance in meters. Must be strictly positive.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when the visibility is not strictly positive.
    • halvingHeight

      @NotNull public FogModel.Builder halvingHeight(@Nullable Double halvingHeight) throws IllegalArgumentException
      Sets the altitude in meters over which the fog thins by half, in other words how tall the fog layer is.

      Pass null to make the fog uniform with altitude (distance-based only). The default is 4000.

      Parameters:
      halvingHeight - the halving height in meters, or null to make the fog uniform with altitude. Must be strictly positive when set.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when the halving height is set and not strictly positive.
    • maximumAltitude

      @NotNull public FogModel.Builder maximumAltitude(double maximumAltitude) throws IllegalArgumentException
      Sets the altitude in meters above which the fog fully fades out as the camera climbs.

      The default is 20000.

      Parameters:
      maximumAltitude - the maximum altitude in meters. Must be strictly positive.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - when the maximum altitude is not strictly positive.
    • build

      @NotNull public FogModel build()
      Builds the fog model.
      Returns:
      the built fog model.