Home Reference Source
public class | source

Mass

Extends:

Initializer → Mass

Sets the mass property on initialized particles.

Static Method Summary

Static Public Methods
public static

fromJSON(json: object): Mass

Creates a Mass initializer from JSON.

Constructor Summary

Public Constructor
public

constructor(min: number, max: number, center: boolean): *

Constructs a Mass initializer instance.

Member Summary

Public Members
public

The mass span which is used to set the particle mass value.

Method Summary

Public Methods
public

initialize(particle: Particle): *

Sets the particle's initial mass.

Inherited Summary

From class Initializer
public static abstract

Returns a new instance of the initializer from the JSON object passed.

public static

Determines if the initializer requires a Web GL API to be provided to its constructor.

public
public

type: *

public

init(emitter: Emitter, particle: Particle): *

Initializes the property on the emitter or particle.

public abstract

initialize(target: object)

Place custom property initialization code in this method in the subclass.

public abstract

reset()

Static Public Methods

public static fromJSON(json: object): Mass source

Creates a Mass initializer from JSON.

Override:

Initializer#fromJSON

Params:

NameTypeAttributeDescription
json object

The JSON to construct the instance from.

Return:

Mass

Return Properties:

NameTypeAttributeDescription
json.min number

The minimum mass

json.max number

The maximum mass

json.center number

The center of the mass

Public Constructors

public constructor(min: number, max: number, center: boolean): * source

Constructs a Mass initializer instance.

Override:

Initializer#constructor

Params:

NameTypeAttributeDescription
min number

The minumum mass for the particle

max number

The maximum mass for the particle

center boolean
  • optional

Determines whether to average the mass value

Return:

*

void

Public Members

public massPan: Span source

The mass span which is used to set the particle mass value.

Public Methods

public initialize(particle: Particle): * source

Sets the particle's initial mass.

Override:

Initializer#initialize

Params:

NameTypeAttributeDescription
particle Particle

the particle to initialize the property on

Return:

*

void