threejs-worldgen
    Preparing search index...

    Class SolarSystem

    Renders a star system for orbital views.

    const solar = new SolarSystem({ model: sky.system, exaggerateSizes: 300 })
    scene.add(solar.object)
    // each frame:
    solar.update(sky.clock.time, camera)
    solar.bodyMatrix('home', planetTerrain.matrix) // place a planet World on the home planet
    Index
    light: PointLight = ...

    The star's light (no falloff), placed at the star; lights your own body materials.

    object: Group<Object3DEventMap> = ...

    Root group. Add it to your scene.

    settings: SolarSystemSettings = ...

    Resolved settings. Change them with SolarSystem.set / SolarSystem.reset.

    system: StarSystem

    The system being drawn.

    time: number = 0

    Simulation time of the last update, seconds since J2000.

    • get originPosition(): Vec3

      Floating-origin position of the origin body (plus offset) at the last update, star frame, metres.

      Returns Vec3

    • Matrix placing a body's frame in render space at true scale (settings.scale, no exaggeration): body-frame metres → render units. Use it as the matrix of a planet World terrain so it sits on (and spins with) the home planet: terrain.matrixAutoUpdate = false; solar.bodyMatrix('home', terrain.matrix).

      Parameters

      • name: string
      • target: Matrix4 = ...

      Returns Matrix4

    • Converts a star-frame position (metres) to render space (no distance compression).

      Parameters

      • p: Vec3
      • out: Vector3 = ...

      Returns Vector3

    • Moves everything to time (seconds since J2000).

      Parameters

      • time: number
      • Optionalcamera: Camera

        Used for distance compression; omit to draw everything at true distance.

      Returns void