Atmosphere
Day/night cycle, sky colors, celestial lighting, weather, and clouds.
Module: hydra
Day/night cycle, sky colors, celestial lighting, weather, and clouds.
Declaration
export class Atmosphere { ... }Properties
timeOfDay
The time of day.
timeOfDay: number;secondsPerHour
The seconds per hour.
secondsPerHour: number;wind
The wind direction and strength.
wind: Magnitude3d;weatherDelegate
The callback used to compute the current weather state.
weatherDelegate: WeatherDelegate;clouds
The cloud system, when clouds have been added.
clouds?: Clouds;sunColor
The sun color.
sunColor: Color;moonColor
The moon color.
moonColor: Color;sunSize
The sun size.
sunSize: number;moonSize
The moon size.
moonSize: number;sunTintStrength
The sun tint strength.
sunTintStrength: number;moonTintStrength
The moon tint strength.
moonTintStrength: number;starIntensity
The star intensity.
starIntensity: number;cycle
Whether the atmosphere advances its time-of-day cycle automatically.
cycle: boolean;Methods
enable
Enable.
enable(): void;disable
Disable.
disable(): void;isEnabled
Reports whether enabled.
isEnabled(): boolean;enableWeather
Enables weather.
enableWeather(): void;disableWeather
Disables weather.
disableWeather(): void;getNormalizedTime
Returns normalized time.
getNormalizedTime(): number;getSunAngle
Returns sun angle.
getSunAngle(): Magnitude3d;getMoonAngle
Returns moon angle.
getMoonAngle(): Magnitude3d;getLightIntensity
Returns light intensity.
getLightIntensity(): number;getLightColor
Returns light color.
getLightColor(): Color;getSkyboxColors
Returns skybox colors.
getSkyboxColors(): Color[];createSkyCubemap
Creates a sky cubemap with the requested face size.
createSkyCubemap(size: number): Cubemap;updateSkyCubemap
Updates an existing cubemap with the current sky colors.
updateSkyCubemap(cubemap: Cubemap): void;castShadowsFromSunlight
Cast shadows from sunlight.
castShadowsFromSunlight(resolution: number): void;useGlobalLight
Configures the use of global light.
useGlobalLight(): void;isDaytime
Reports whether daytime.
isDaytime(): boolean;setTime
Sets the atmosphere clock using hours, minutes, and seconds.
setTime(hours: number, minutes: number, seconds: number): void;addClouds
Creates clouds using the supplied noise frequency and division count.
addClouds(frequency: number, numDivisions: number): void;resetRuntimeState
Resets runtime state to its initial state.
resetRuntimeState(): void;