PropertyMixer.html 2.5 KB

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