MapSceneLights (API Reference)
Class MapSceneLights
Manage the lights and their attributes in a scene.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis callback function allows handling errors that occur during the setting of light attributes.static enumError enum indicating reasons for failure when setting light attributes.static enumThe scene uses three categories of lighting which are: Main light, Back light and Rim light.static final classThe direction of lights as a pair of azimuth and altitude angles. -
Method Summary
Modifier and TypeMethodDescriptiongetColor(MapSceneLights.Category category) Retrieves the current color of the light based on its category.getDirection(MapSceneLights.Category category) Retrieves the current direction of the light based on its category.getIntensity(MapSceneLights.Category category) Retrieves the current intensity of the light based on its category.voidreset()Resets all attributes of each light to their default values based on the current map scene settings.voidsetColor(MapSceneLights.Category category, Color color, MapSceneLights.AttributeSettingCallback callback) Set a new color for the light based on its category.voidsetDirection(MapSceneLights.Category category, MapSceneLights.Direction direction, MapSceneLights.AttributeSettingCallback callback) Set a new direction for the light based on its category.voidsetIntensity(MapSceneLights.Category category, double intensity, MapSceneLights.AttributeSettingCallback callback) Set a new intensity for the light based on its category.
-
Method Details
-
setColor
public void setColor(@NonNull MapSceneLights.Category category, @NonNull Color color, @Nullable MapSceneLights.AttributeSettingCallback callback) Set a new color for the light based on its category.
- Parameters:
category-The category of light for which the color is set.
color-The Color type includes red, green, blue, and alpha components. The value of these components must be inside the range [0, 1].
callback-Optional callback that will receive the result of this operation.
-
setIntensity
public void setIntensity(@NonNull MapSceneLights.Category category, double intensity, @Nullable MapSceneLights.AttributeSettingCallback callback) Set a new intensity for the light based on its category.
- Parameters:
category-The category of light for which the intensity is set.
intensity-The light intensity value must be inside the range [0, 10]. The intensity value is clamped to this range. If the value falls outside its supported range, it will be adjusted to stay within the range. Note: When the intensity value is big, 3D objects might turn completely white because all the color channels could go over the limit of 1.0.
callback-Optional callback that will receive the result of this operation.
-
setDirection
public void setDirection(@NonNull MapSceneLights.Category category, @NonNull MapSceneLights.Direction direction, @Nullable MapSceneLights.AttributeSettingCallback callback) Set a new direction for the light based on its category.
- Parameters:
category-The category of light for which the direction is set.
direction-The Direction contains azimuth and altitude angles in degrees.
callback-Optional callback that will receive the result of this operation.
-
getColor
Retrieves the current color of the light based on its category.
- Parameters:
category-The category of light from which the color is retrieved.
- Returns:
The current color of the light, or
nullif the light is missing from the loaded scene or MapScene is not intitialized.
-
getIntensity
Retrieves the current intensity of the light based on its category.
- Parameters:
category-The category of light from which the intensity is retrieved.
- Returns:
The current intensity of the light, or
nullif the light is missing from the loaded scene or MapScene is not intitialized.
-
getDirection
Retrieves the current direction of the light based on its category.
- Parameters:
category-The category of light from which the direction is retrieved.
- Returns:
The current direction of the light, or
nullif the light is missing from the loaded scene or MapScene is not intitialized.
-
reset
public void reset()Resets all attributes of each light to their default values based on the current map scene settings.
-