threejs-worldgen
    Preparing search index...

    Interface SkyState

    Everything the sky knows about one instant, as seen from the camera. Directions are unit render-space vectors.

    interface SkyState {
        altitude: number;
        bodyMatrix: Mat3;
        cameraToPlanet: Vec3;
        celestialMatrix: Mat3;
        east: Vec3;
        frame: SkyFrame;
        latitude: number;
        layer: LayerName;
        longitude: number;
        moonAngularRadius: number;
        moonAzimuth: number;
        moonDirection: Vec3;
        moonDistance: number;
        moonElevation: number;
        moonIllumination: number;
        moonMatrix: Mat3;
        moonPhase: number;
        moonPhaseAngle: number;
        night: number;
        north: Vec3;
        planetRadius: number;
        skyLuminance: number;
        solarTime: number;
        sunAngularRadius: number;
        sunAzimuth: number;
        sunDirection: Vec3;
        sunDistance: number;
        sunElevation: number;
        time: number;
        up: Vec3;
    }
    Index
    altitude: number

    Camera height above the planet's base sphere, metres.

    bodyMatrix: Mat3

    Rotation from render space into the home planet's body frame (identity in the planet frame).

    cameraToPlanet: Vec3

    Camera position minus planet centre, render space, metres (feed this to ray-marchers).

    celestialMatrix: Mat3

    Rotation from render space to the star frame (fixed stars). Stars use it; it turns with sidereal time.

    east: Vec3

    Local east at the observer.

    frame: SkyFrame

    Render-space convention in use.

    latitude: number

    Observer latitude, degrees.

    layer: LayerName

    Atmosphere layer the camera is in (set by Sky).

    longitude: number

    Observer longitude, degrees.

    moonAngularRadius: number

    Apparent radius of the moon disc, radians (0 without a moon).

    moonAzimuth: number

    Moon azimuth, degrees.

    moonDirection: Vec3

    Towards the moon (topocentric: includes parallax).

    moonDistance: number

    Distance to the moon, metres (Infinity without a moon).

    moonElevation: number

    Moon elevation, degrees.

    moonIllumination: number

    Lit fraction of the moon disc, 0 (new) .. 1 (full).

    moonMatrix: Mat3

    Rotation from render space into the moon's body frame (keeps its maria facing the planet).

    moonPhase: number

    Position in the lunar cycle, 0..1: 0 new, 0.25 first quarter, 0.5 full, 0.75 last quarter.

    moonPhaseAngle: number

    Sun–moon–observer angle, degrees: 180 at new moon, 0 at full.

    night: number

    0 by day … 1 at night (set by Sky from its twilight settings).

    north: Vec3

    Local north at the observer.

    planetRadius: number

    Home planet radius, metres.

    skyLuminance: number

    Luminance of the sky at the zenith, in renderer units (set by Sky).

    solarTime: number

    Local apparent solar time at the observer, hours 0..24 (12 = sun on the meridian).

    sunAngularRadius: number

    Apparent radius of the sun disc, radians.

    sunAzimuth: number

    Sun azimuth, degrees from north through east.

    sunDirection: Vec3

    Towards the sun.

    sunDistance: number

    Distance to the sun, metres.

    sunElevation: number

    Sun elevation above the horizon, degrees.

    time: number

    Simulation seconds since J2000.

    up: Vec3

    Local up at the observer.