spacekit
    Preparing search index...

    Class SpaceObject

    An object that can be added to a visualization.

    const myObject = viz.addObject('planet1', {
    position: [0, 0, 0],
    scale: [1, 1, 1],
    particleSize: 5,
    labelText: 'My object',
    labelUrl: 'http://...',
    hideOrbit: false,
    ephem: new Spacekit.Ephem({...}),
    textureUrl: '/path/to/spriteTexture.png',
    basePath: '/base',
    ecliptic: {
    lineColor: 0xCCCCCC,
    displayLines: false,
    },
    theme: {
    color: 0xFFFFFF,
    orbitColor: 0x888888,
    },
    });

    Hierarchy (View Summary)

    Implements

    Index
    • Parameters

      • id: string

        Unique id of this object

      • options: SpaceObjectOptions

        Options container

        • Optionalatmosphere?: {
              color?: number;
              enable?: boolean;
              innerSizeRatio?: number;
              outerSizeRatio?: number;
          }
        • OptionalaxialTilt?: number
        • OptionalbasePath?: string
        • Optionalcolor?: number
        • Optionaldebug?: { showAxes: boolean; showGrid: boolean }
        • Optionalecliptic?: { displayLines?: boolean; lineColor?: number }
        • Optionalephem?: Ephem
        • OptionalephemTable?: EphemerisTable
        • OptionalhideOrbit?: boolean
        • OptionallabelText?: string
        • OptionallabelUrl?: string
        • OptionallevelsOfDetail?: { radii: number; segments: number }[]
        • OptionalorbitPathSettings?: {
              leadDurationYears?: number;
              numberSamplePoints?: number;
              trailDurationYears?: number;
          }
        • OptionalparticleSize?: number
        • Optionalposition?: Coordinate3d
        • Optionalradius?: number
        • Optionalrotation?: {
              betaDeg?: number;
              enable: boolean;
              jd0?: number;
              lambdaDeg?: number;
              period: number;
              phi0?: number;
              speed?: number;
              yorp?: number;
          }
        • Optionalscale?: [number, number, number]
        • Optionalshape?: { color?: number; shapeUrl?: string }
        • OptionaltextureUrl?: string
        • Optionaltheme?: { color?: number; orbitColor?: number }
      • simulation: Simulation
      • autoInit: boolean = true

        Automatically initialize this object. If false you must call init() manually.

      Returns SpaceObject

      Orbit

    _id: string
    _initialized: boolean
    _renderMethod?: "SPRITE" | "PARTICLESYSTEM" | "ROTATING_OBJECT" | "SPHERE"
    _simulation: Simulation
    • Gets the THREE.js objects that represent this SpaceObject. The first object returned is the primary object. Other objects may be returned, such as rings, ellipses, etc.

      Returns Object3D<Object3DEventMap>[]

      A list of THREE.js objects

    • Specifies the object that is used to compute the bounding box. By default, this will be the first THREE.js object in this class's list of objects.

      Returns Promise<Object3D<Object3DEventMap>>

      THREE.js object

    • Gets the color of this object. Usually this corresponds to the color of the dot representing the object as well as its orbit.

      Returns number

      A hexidecimal color value, e.g. 0xFFFFFF

    • Gets the unique ID of this object.

      Returns string

      Unique ID

    • Gets label visilibity status.

      Returns boolean

      Whether label is visible.

    • Gets the {Orbit} object for this SpaceObject.

      Returns Orbit | undefined

      Orbit object

    • Gets the visualization coordinates of this object at a given time.

      Parameters

      • jd: number

        JD date

      Returns Coordinate3d

      [X, Y,Z] coordinates

    • Initializes label and three.js objects. Called automatically unless you've set autoInit to false in constructor (this init is suppressed by some child classes).

      Returns boolean

    • Determines whether object is ready to be measured or added to scene.

      Returns boolean

      True if ready

    • Determines whether object is static (can't change its position) or whether its position can be updated (ie, it has ephemeris)

      Returns boolean

      Whether this object can change its position.

    • Make this object orbit another orbit.

      Parameters

      • spaceObj: SpaceObject

        The SpaceObject that will serve as the origin of this object's orbit.

      Returns void

    • Toggle the visilibity of the label.

      Parameters

      • val: boolean

        Whether to show or hide.

      Returns void

    • Updates the position of this object. Applicable only if this object is a sprite and not a particle type.

      Parameters

      • x: number

        X position

      • y: number

        Y position

      • z: number

        Z position

      Returns void

    • Protected

      Used by child classes to set the object that gets its position updated.

      Parameters

      • obj: Object3D

        Any THREE.js object

      Returns void

    • Updates the object and its label positions for a given time.

      Parameters

      • jd: number

        JD date

      • force: boolean = false

        Whether to force an update regardless of checks for movement.

      Returns void