PropertyMixer.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. <div class="desc">
  13. Buffered scene graph property that allows weighted accumulation.
  14. </div>
  15. <h2>Constructor</h2>
  16. <h3>[name]( binding, typeName, valueSize )</h3>
  17. <div>
  18. -- binding <br />
  19. -- typeName <br />
  20. -- valueSize <br />
  21. </div>
  22. <h2>Properties</h2>
  23. <h3>[property:Number binding]</h3>
  24. <div>
  25. </div>
  26. <h3>[property:Number buffer]</h3>
  27. <div>
  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'.<br />
  31. 'accu0' and 'accu1' are used frame-interleaved for the cumulative result and
  32. are compared to detect changes.<br />
  33. 'orig' stores the original state of the property.<br />
  34. </div>
  35. <h3>[property:Number cumulativeWeight]</h3>
  36. <div>
  37. Default is *0*.
  38. </div>
  39. <h3>[property:Number valueSize]</h3>
  40. <div>
  41. </div>
  42. <h3>[property:Number referenceCount]</h3>
  43. <div>
  44. Default is *0*.
  45. </div>
  46. <h3>[property:Number useCount]</h3>
  47. <div>
  48. Default is *0*.
  49. </div>
  50. <h2>Methods</h2>
  51. <h3>[method:null accumulate]( accuIndex, weight )</h3>
  52. <div>
  53. Accumulate data in [page:PropertyMixer.buffer buffer][accuIndex] 'incoming' region into 'accu[i]'.<br />
  54. If weight is *0* this does nothing.
  55. </div>
  56. <h3>[method:null apply]( accuIndex )</h3>
  57. <div>
  58. Apply the state of [page:PropertyMixer.buffer buffer] 'accu[i]' to the binding when accus differ.
  59. </div>
  60. <h3>[method:null saveOriginalState]( )</h3>
  61. <div>
  62. Remember the state of the bound property and copy it to both accus.
  63. </div>
  64. <h3>[method:null restoreOriginalState]( )</h3>
  65. <div>
  66. Apply the state previously taken via 'saveOriginalState' to the binding.
  67. </div>
  68. <h2>Source</h2>
  69. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  70. </body>
  71. </html>