PropertyMixer.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Buffered scene graph property that allows weighted accumulation; used internally.
  14. </p>
  15. <h2>Constructor</h2>
  16. <h3>[name]( [param:PropertyBinding binding], [param:String typeName], [param:Number valueSize] )</h3>
  17. <p>
  18. -- binding <br />
  19. -- typeName <br />
  20. -- valueSize <br />
  21. </p>
  22. <h2>Properties</h2>
  23. <h3>[property:PropertyBinding binding]</h3>
  24. <p>
  25. </p>
  26. <h3>[property:TypedArray buffer]</h3>
  27. <p>
  28. Buffer with size [page:PropertyMixer valueSize] * 4. <br /><br />
  29. This has the layout: [ incoming | accu0 | accu1 | orig ]<br /><br />
  30. Interpolators can use .buffer as their .result and the data then goes to 'incoming'.
  31. 'accu0' and 'accu1' are used frame-interleaved for the cumulative result and
  32. are compared to detect changes. 'orig' stores the original state of the property.
  33. </p>
  34. <h3>[property:Number cumulativeWeight]</h3>
  35. <p>
  36. Default is *0*.
  37. </p>
  38. <h3>[property:Number valueSize]</h3>
  39. <p>
  40. </p>
  41. <h3>[property:Number referenceCount]</h3>
  42. <p>
  43. Default is *0*.
  44. </p>
  45. <h3>[property:Number useCount]</h3>
  46. <p>
  47. Default is *0*.
  48. </p>
  49. <h2>Methods</h2>
  50. <h3>[method:null accumulate]( [param:Number accuIndex], [param:Number weight] )</h3>
  51. <p>
  52. Accumulate data in [page:PropertyMixer.buffer buffer][accuIndex] 'incoming' region into 'accu[i]'.<br />
  53. If weight is *0* this does nothing.
  54. </p>
  55. <h3>[method:null apply]( [param:Number accuIndex] )</h3>
  56. <p>
  57. Apply the state of [page:PropertyMixer.buffer buffer] 'accu[i]' to the binding when accus differ.
  58. </p>
  59. <h3>[method:null saveOriginalState]( )</h3>
  60. <p>
  61. Remember the state of the bound property and copy it to both accus.
  62. </p>
  63. <h3>[method:null restoreOriginalState]( )</h3>
  64. <p>
  65. Apply the state previously taken via 'saveOriginalState' to the binding.
  66. </p>
  67. <h2>Source</h2>
  68. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  69. </body>
  70. </html>