Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SphereObject

Simulates a planet or other object as a perfect sphere.

Hierarchy

Index

Constructors

constructor

Properties

Protected _context

Protected _id

_id: string

Protected _initialized

_initialized: boolean

Protected _materials

_materials: Material[]

Protected _obj

_obj: Object3D

Protected _options

Protected Optional _renderMethod

_renderMethod: "SPRITE" | "PARTICLESYSTEM" | "ROTATING_OBJECT" | "SPHERE"

Protected _simulation

_simulation: Simulation

Methods

addRings

  • addRings(innerRadiusKm: number, outerRadiusKm: number, texturePath: string, segments?: number): void
  • Add rings around this object.

    Parameters

    • innerRadiusKm: number

      Inner radius of ring.

    • outerRadiusKm: number

      Outer radius of ring.

    • texturePath: string

      Full path to 1xN ring texture. (each pixel represents the color of a full circle within the ring)

    • segments: number = 128

      Number of segments to use to render ring. (optional)

    Returns void

get3jsObjects

  • get3jsObjects(): Object3D[]

getBoundingObject

  • getBoundingObject(): Promise<Object3D>
  • 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>

    THREE.js object

getColor

  • getColor(): number
  • 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

getId

  • getId(): string

getLabelVisibility

  • getLabelVisibility(): boolean

getOrbit

  • getOrbit(): undefined | Orbit

getPosition

Private getScaledRadius

  • getScaledRadius(): number

init

  • init(): boolean
  • 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

initRotation

  • initRotation(): void

isReady

  • isReady(): boolean

isStaticObject

  • isStaticObject(): boolean
  • 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.

orbitAround

removalCleanup

  • removalCleanup(): void

Private renderAtmosphereComponent

  • renderAtmosphereComponent(radius: number, size: number, coefficient: number, power: number, colorObj: Color): Mesh<SphereGeometry, ShaderMaterial>
  • Parameters

    • radius: number

      Radius of object

    • size: number

      Size of atmosphere

    • coefficient: number

      Coefficient value

    • power: number

      Power value

    • colorObj: Color

      Color of atmosphere

    Returns Mesh<SphereGeometry, ShaderMaterial>

Private renderFullAtmosphere

  • renderFullAtmosphere(): null | LOD

setLabelVisibility

  • setLabelVisibility(val: boolean): void

setPosition

  • setPosition(x: number, y: number, z: number): 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 setPositionedObject

  • setPositionedObject(obj: Object3D): void

startRotation

  • startRotation(): void

stopRotation

  • stopRotation(): void

update

  • update(jd: number, force?: boolean): void

Generated using TypeDoc