Packagecom.threerings.display
Classpublic class Siner

Tracks multiple sine waves with different periods and amplitudes, and returns an instantaneous additive amplitude.



Public Properties
 PropertyDefined by
  value : Number
[read-only] Access the instantaneous value, which can range from [ -totalAmplitude, totalAmplitude ].
Siner
Protected Properties
 PropertyDefined by
  _amps : Array
Siner
  _incs : Array
Siner
  _stamp : Number
Siner
  _values : Array
Siner
Public Methods
 MethodDefined by
  
Siner(... args)
Siner
  
randomize():void
Randomize the value.
Siner
  
reset():void
Reset to 0, with the amplitude about to increase.
Siner
Protected Constants
 ConstantDefined by
  TWO_PI : Number
[static]
Siner
Property detail
_ampsproperty
protected var _amps:Array
_incsproperty 
protected var _incs:Array
_stampproperty 
protected var _stamp:Number
valueproperty 
value:Number  [read-only]

Access the instantaneous value, which can range from [ -totalAmplitude, totalAmplitude ]. Note: timestamps are only kept relative to the last access of the value, and floating point math is used, so things could get a little "off" after a while, and the frequency with which you sample the value will impact the error. You cope.

Implementation
    public function get value():Number
_valuesproperty 
protected var _values:Array
Constructor detail
Siner()constructor
public function Siner(... args)

Parameters
... args — amplitude1, period1, amplitude2, period2... Periods are specified in seconds. If constructed with more than one amplitude, the amplitudes are additive. The Siner will start in the reset() state.
Method detail
randomize()method
public function randomize():void

Randomize the value.

reset()method 
public function reset():void

Reset to 0, with the amplitude about to increase.

Constant detail
TWO_PIconstant
protected static const TWO_PI:Number