Buffered scene graph property that allows weighted accumulation; used internally.


PropertyMixer(binding : PropertyBinding, typeName : String, valueSize : Number)

-- binding
-- typeName
-- valueSize


.binding undefined : PropertyBinding

.buffer undefined : TypedArray

Buffer with size valueSize * 4.

This has the layout: [incoming | accu0 | accu1 | orig]

Interpolators can use .buffer as their .result and the data then goes to 'incoming'. 'accu0' and 'accu1' are used frame-interleaved for the cumulative result and are compared to detect changes. 'orig' stores the original state of the property.

.cumulativeWeight undefined : Number

Default is 0.

.valueSize undefined : Number

.referenceCount undefined : Number

Default is 0.

.useCount undefined : Number

Default is 0.


.accumulate (accuIndex : Number, weight : Number) : null

Accumulate data in buffer[accuIndex] 'incoming' region into 'accu[i]'.
If weight is 0 this does nothing.

.apply (accuIndex : Number) : null

Apply the state of buffer 'accu[i]' to the binding when accus differ.

.saveOriginalState () : null

Remember the state of the bound property and copy it to both accus.

.restoreOriginalState () : null

Apply the state previously taken via 'saveOriginalState' to the binding.


For more info on how to obtain the source code of this module see this page.