Home Reference Source
import {SphereObject} from 'spacekit/src/SphereObject.js'
public class | source

SphereObject

Extends:

SpaceObjectRotatingObject → SphereObject

Simulates a planet or other object as a perfect sphere.

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public

addRings(innerRadiusKm: Number, outerRadiusKm: Number, texturePath: String, segments: Number)

Add rings around this object.

public

init()

public

update(jd: *)

Update the location of this object at a given time.

Inherited Summary

From class SpaceObject
public

get3jsObjects(): Array<THREE.Object>

Gets the THREE.js objects that represent this SpaceObject.

public

getBoundingObject(): THREE.Object3D

Specifies the object that is used to compute the bounding box.

public

Gets the color of this object.

public

Gets the unique ID of this object.

public

Gets label visilibity status.

public

Gets the {Orbit} object for this SpaceObject.

public

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

public

Initializes label and three.js objects.

public

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

public

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

public

orbitAround(spaceObj: Object)

Make this object orbit another orbit.

public

Toggle the visilibity of the label.

public

Updates the position of this object.

public

update(jd: Number)

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

From class RotatingObject
public

get3jsObjects(): Array<THREE.Object>

Gets the THREE.js objects that represent this SpaceObject.

public

init()

public
public

Begin rotating this object.

public

Stop rotation of this object.

public

update(jd: Number)

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

Public Constructors

public constructor() source

Override:

RotatingObject#constructor

Params:

NameTypeAttributeDescription
options.textureUrl String

Path to basic texture (optional)

options.bumpMapUrl String

Path to bump map (optional)

options.specularMapUrl String

Path to specular map (optional)

options.color Number

Hex color of the sphere

options.axialTilt Number

Axial tilt in degrees

options.radius Number

Radius of sphere. Defaults to 1

options.levelsOfDetail Object

List of {threshold: x, segments: y}, where threshold is radii distance and segments is the number number of sphere faces to render.

options.atmosphere Object

Atmosphere options

options.atmosphere.enable Object

Show atmosphere

options.atmosphere.color Object

Atmosphere color

options.atmosphere.innerSizeRatio Object

Size ratio of the inner atmosphere to the radius of the sphere. Defaults to 0.025

options.atmosphere.outerSizeRatio Object

Size ratio of the outer atmosphere to the radius of the sphere. Defaults to 0.15

options.debug Object

Debug options

options.debug.showAxes boolean

Show axes

See:

Public Methods

public addRings(innerRadiusKm: Number, outerRadiusKm: Number, texturePath: String, segments: Number) source

Add rings around this object.

Params:

NameTypeAttributeDescription
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

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

public init() source

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).

Override:

RotatingObject#init

public update(jd: *) source

Update the location of this object at a given time. Note that this is computed on CPU.

Override:

RotatingObject#update

Params:

NameTypeAttributeDescription
jd *