PropertyMixer.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 valueSize]</h3>
  38. <p>
  39. </p>
  40. <h3>[property:Number referenceCount]</h3>
  41. <p>
  42. Default is *0*.
  43. </p>
  44. <h3>[property:Number useCount]</h3>
  45. <p>
  46. Default is *0*.
  47. </p>
  48. <h2>Methods</h2>
  49. <h3>[method:null accumulate]( [param:Number accuIndex], [param:Number weight] )</h3>
  50. <p>
  51. Accumulate data in [page:PropertyMixer.buffer buffer][accuIndex] 'incoming' region into 'accu[i]'.<br />
  52. If weight is *0* this does nothing.
  53. </p>
  54. <h3>[method:null apply]( [param:Number accuIndex] )</h3>
  55. <p>
  56. Apply the state of [page:PropertyMixer.buffer buffer] 'accu[i]' to the binding when accus differ.
  57. </p>
  58. <h3>[method:null saveOriginalState]( )</h3>
  59. <p>
  60. Remember the state of the bound property and copy it to both accus.
  61. </p>
  62. <h3>[method:null restoreOriginalState]( )</h3>
  63. <p>
  64. Apply the state previously taken via 'saveOriginalState' to the binding.
  65. </p>
  66. <h2>Source</h2>
  67. <p>
  68. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  69. </p>
  70. </body>
  71. </html>