PropertyMixer.html 2.2 KB
Newer Older
1 2
<!DOCTYPE html>
<html lang="en">
3 4 5 6 7 8 9 10 11
	<head>
		<meta charset="utf-8" />
		<base href="../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>[name]</h1>
12

13
		<p class="desc">
14
		Buffered scene graph property that allows weighted accumulation; used internally.
15
		</p>
16 17


18
		<h2>Constructor</h2>
19 20


21
		<h3>[name]( [param:PropertyBinding binding], [param:String typeName], [param:Number valueSize] )</h3>
22
		<p>
23 24 25
			-- binding <br />
			-- typeName <br />
			-- valueSize <br />
26
		</p>
27 28


29
		<h2>Properties</h2>
30 31


32
		<h3>[property:PropertyBinding binding]</h3>
33
		<p>
34

35
		</p>
36

37
		<h3>[property:TypedArray buffer]</h3>
38
		<p>
39 40
			Buffer with size [page:PropertyMixer valueSize] * 4. <br /><br />
			This has the layout: [ incoming | accu0 | accu1 | orig ]<br /><br />
41
			Interpolators can use .buffer as their .result and the data then goes to 'incoming'.
42
			'accu0' and 'accu1' are used frame-interleaved for the cumulative result and
43 44
			are compared to detect changes. 'orig' stores the original state of the property.
		</p>
45

46
		<h3>[property:Number cumulativeWeight]</h3>
47
		<p>
48
			Default is *0*.
49
		</p>
50

51
		<h3>[property:Number valueSize]</h3>
52
		<p>
53

54
		</p>
55

56
		<h3>[property:Number referenceCount]</h3>
57
		<p>
58
			Default is *0*.
59
		</p>
60

61
		<h3>[property:Number useCount]</h3>
62
		<p>
63
			Default is *0*.
64
		</p>
65 66


67
		<h2>Methods</h2>
68 69


70
		<h3>[method:null accumulate]( [param:Number accuIndex], [param:Number weight] )</h3>
71
		<p>
72
			Accumulate data in [page:PropertyMixer.buffer buffer][accuIndex] 'incoming' region into 'accu[i]'.<br />
73

74
			If weight is *0* this does nothing.
75
		</p>
76

77
		<h3>[method:null apply]( [param:Number accuIndex] )</h3>
78
		<p>
79
			Apply the state of [page:PropertyMixer.buffer buffer] 'accu[i]' to the binding when accus differ.
80
		</p>
81

82
		<h3>[method:null saveOriginalState]( )</h3>
83
		<p>
84
			Remember the state of the bound property and copy it to both accus.
85
		</p>
86

87
		<h3>[method:null restoreOriginalState](  )</h3>
88
		<p>
89
			Apply the state previously taken via 'saveOriginalState' to the binding.
90
		</p>
91 92


93
		<h2>Source</h2>
94 95


96 97
		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
	</body>
98
</html>