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

KeplerParticles

An efficient way to render many objects in space with Kepler orbits. Primarily used by Simulation to render all non-static objects.

See:

Constructor Summary

Public Constructor
public

constructor(options: Object, contextOrSimulation: Object)

Method Summary

Public Methods
public

addParticle(ephem: Ephem, options: Object): Number

Add a particle to this particle system.

public

get3jsObjects(): Array<THREE.Object>

Get THREE.js objects that comprise this point cloud

public

Get unique id for this object.

public

hideParticle(offset: *)

Hides the particle at the given offset so it is no longer drawn.

public

setParticleOrigin(offset: Number, newOrigin: Array<Number>)

Change the origin attribute of a particle.

public

update(jd: Number)

Update the position for all particles

Public Constructors

public constructor(options: Object, contextOrSimulation: Object) source

Params:

NameTypeAttributeDescription
options Object

Options container

options.textureUrl Object

Template url for sprite

options.basePath Object

Base path for simulation supporting files

options.jd Number

JD date value

options.maxNumParticles Number

Maximum number of particles to display. Defaults to 4096

options.defaultSize Number

Default size of particles. Note this can be overriden by SpaceObject particleSize. Defaults to 25

contextOrSimulation Object

Simulation context or object

Public Methods

public addParticle(ephem: Ephem, options: Object): Number source

Add a particle to this particle system.

Params:

NameTypeAttributeDescription
ephem Ephem

Kepler ephemeris

options Object

Options container

options.particleSize Number

Size of particles

options.color Number

Color of particles

Return:

Number

The index of this article in the attribute list.

public get3jsObjects(): Array<THREE.Object> source

Get THREE.js objects that comprise this point cloud

Return:

Array<THREE.Object>

List of objects to add to THREE.js scene

public getId(): String source

Get unique id for this object.

Return:

String

Unique id

public hideParticle(offset: *) source

Hides the particle at the given offset so it is no longer drawn. The particle still takes up space in the array though.

Params:

NameTypeAttributeDescription
offset *

public setParticleOrigin(offset: Number, newOrigin: Array<Number>) source

Change the origin attribute of a particle.

Params:

NameTypeAttributeDescription
offset Number

The location of this particle in the attributes * array.

newOrigin Array<Number>

The new XYZ coordinates of the body that this particle orbits.

public update(jd: Number) source

Update the position for all particles

Params:

NameTypeAttributeDescription
jd Number

JD date