Class MapSceneLights
Class MapSceneLights
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.mapview.MapSceneLights
-
public final class MapSceneLights extends NativeBase
Manage the lights and their attributes in a scene.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMapSceneLights.AttributeSettingCallbackThis callback function allows handling errors that occur during the setting of light attributes.static classMapSceneLights.AttributeSettingErrorError enum indicating reasons for failure when setting light attributes.static classMapSceneLights.CategoryThe scene uses three categories of lighting which are: Main light, Back light and Rim light.static classMapSceneLights.DirectionThe direction of lights as a pair of azimuth and altitude angles.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetColor(MapSceneLights.Category category)Retrieves the current color of the light based on its category.MapSceneLights.DirectiongetDirection(MapSceneLights.Category category)Retrieves the current direction of the light based on its category.java.lang.DoublegetIntensity(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 Detail
-
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
@Nullable public Color getColor(@NonNull MapSceneLights.Category category)
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
@Nullable public java.lang.Double getIntensity(@NonNull MapSceneLights.Category category)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
@Nullable public MapSceneLights.Direction getDirection(@NonNull MapSceneLights.Category category)
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.
-
-