EnvironmentSkyOverride
Since next
Fields of meta.environment.sky, the ones a weather change reaches for named; any other may be written too.
Signature
export interface EnvironmentSkyOverride {
/** What draws the sky: `procedural`, `hdr`, `color` or `atmosphere`. */
kind?: SkyKind
/** A procedural sky's preset (`clear-noon`, `golden-hour`, `overcast`, `dusk`, `night`), or an atmosphere sky's time of day. */
preset?: string | null
/** Scalar on the whole environment, 0 or more. */
intensity?: number
/** Yaw of the whole sky, radians. */
rotation?: number
/** An atmosphere sky's cloud layer. */
clouds?: EnvironmentCloudsOverride | null
[field: string]: unknown
}
Import: import type { EnvironmentSkyOverride } from "@argus/api"
Members
| Member | Signature | Description |
|---|---|---|
kind | kind?: SkyKind | What draws the sky: procedural, hdr, color or atmosphere. |
preset | preset?: string | null | A procedural sky's preset (clear-noon, golden-hour, overcast, dusk, night), or an atmosphere sky's time of day. |
intensity | intensity?: number | Scalar on the whole environment, 0 or more. |
rotation | rotation?: number | Yaw of the whole sky, radians. |
clouds | clouds?: EnvironmentCloudsOverride | null | An atmosphere sky's cloud layer. |
Example
The tested fixture fixtures/recipes/jump-pad-and-elevator/scenes/behaviors/camera-zone.ts.
import type { Behavior } from "@argus/api"
/**
* A trigger volume that retunes the camera while the player is inside it.
*
* The engine has no camera-zone concept and needs none: a volume, a `trigger` component and this.
* Here the player's behaviour owns the camera (it re-sends its params when the view is turned), so
* the zone tells it what to change rather than calling `ctx.camera.set` itself. In a scene where
* nothing else writes the camera, the zone can call `ctx.camera.set(kind, params)` directly.
*/
interface Props {
/** `ctx.camera.set` params to merge in on the way in, and on the way out. */
inside?: Record<string, unknown>
outside?: Record<string, unknown>
}
export default {
onTrigger(ctx, trigger) {
const params = trigger.entering ? ctx.props.inside : ctx.props.outside
if (params) ctx.events.emit("camera-zone", { target: trigger.other.id, params })
},
} satisfies Behavior<Record<string, never>, Props>