VelocityNode.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>VelocityNode - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="TempNode.html">TempNode</a> → </p>
  13. <h1 translate="no">VelocityNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A node for representing motion or velocity vectors. Foundation
  17. for advanced post processing effects like motion blur or TRAA.</p>
  18. <p>The node keeps track of the model, view and projection matrices
  19. of the previous frame and uses them to compute offsets in NDC space.
  20. These offsets represent the final velocity.</p></div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="VelocityNode" translate="no">new <a href="#VelocityNode">VelocityNode</a><span class="signature">()</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new vertex color node.</p>
  29. </div>
  30. </div>
  31. </div>
  32. <h2 class="subsection-title">Properties</h2>
  33. <div class="member">
  34. <h3 class="name" id="previousCameraViewMatrix" translate="no">.<a href="#previousCameraViewMatrix">previousCameraViewMatrix</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;mat4></span> </h3>
  35. <div class="description">
  36. <p>Uniform node representing the previous view matrix.</p>
  37. <p>Default is <code>null</code>.</p>
  38. </div>
  39. </div>
  40. <div class="member">
  41. <h3 class="name" id="previousModelWorldMatrix" translate="no">.<a href="#previousModelWorldMatrix">previousModelWorldMatrix</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;mat4></span> </h3>
  42. <div class="description">
  43. <p>Uniform node representing the previous model matrix in world space.</p>
  44. <p>Default is <code>null</code>.</p>
  45. </div>
  46. </div>
  47. <div class="member">
  48. <h3 class="name" id="previousProjectionMatrix" translate="no">.<a href="#previousProjectionMatrix">previousProjectionMatrix</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;mat4></span> </h3>
  49. <div class="description">
  50. <p>Uniform node representing the previous projection matrix.</p>
  51. <p>Default is <code>null</code>.</p>
  52. </div>
  53. </div>
  54. <div class="member">
  55. <h3 class="name" id="projectionMatrix" translate="no">.<a href="#projectionMatrix">projectionMatrix</a><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
  56. <div class="description">
  57. <p>The current projection matrix.</p>
  58. <p>Default is <code>null</code>.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="updateAfterType" translate="no">.<a href="#updateAfterType">updateAfterType</a><span class="type-signature"> : string</span> </h3>
  63. <div class="description">
  64. <p>Overwritten since velocity nodes save data after the update.</p>
  65. <p>Default is <code>'object'</code>.</p>
  66. </div>
  67. <dl class="details">
  68. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateAfterType">TempNode#updateAfterType</a></dt>
  69. </dl>
  70. </div>
  71. <div class="member">
  72. <h3 class="name" id="updateType" translate="no">.<a href="#updateType">updateType</a><span class="type-signature"> : string</span> </h3>
  73. <div class="description">
  74. <p>Overwritten since velocity nodes are updated per object.</p>
  75. <p>Default is <code>'object'</code>.</p>
  76. </div>
  77. <dl class="details">
  78. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateType">TempNode#updateType</a></dt>
  79. </dl>
  80. </div>
  81. <h2 class="subsection-title">Methods</h2>
  82. <h3 class="name name-method" id="setProjectionMatrix" translate="no">.<a href="#setProjectionMatrix">setProjectionMatrix</a><span class="signature">( projectionMatrix : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span> </h3>
  83. <div class="method">
  84. <div class="description">
  85. <p>Sets the given projection matrix.</p>
  86. </div>
  87. <table class="params">
  88. <tbody>
  89. <tr>
  90. <td class="name">
  91. <strong>projectionMatrix</strong>
  92. </td>
  93. <td class="description last">
  94. <p>The projection matrix to set.</p>
  95. </td>
  96. </tr>
  97. </tbody>
  98. </table>
  99. </div>
  100. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec2></span> </h3>
  101. <div class="method">
  102. <div class="description">
  103. <p>Implements the velocity computation based on the previous and current vertex data.</p>
  104. </div>
  105. <table class="params">
  106. <tbody>
  107. <tr>
  108. <td class="name">
  109. <strong>builder</strong>
  110. </td>
  111. <td class="description last">
  112. <p>A reference to the current node builder.</p>
  113. </td>
  114. </tr>
  115. </tbody>
  116. </table>
  117. <dl class="details">
  118. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  119. </dl>
  120. <dl class="details">
  121. <dt class="tag-returns"><strong>Returns:</strong> The motion vector.</dt>
  122. </dl>
  123. </div>
  124. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  125. <div class="method">
  126. <div class="description">
  127. <p>Updates velocity specific uniforms.</p>
  128. </div>
  129. <table class="params">
  130. <tbody>
  131. <tr>
  132. <td class="name">
  133. <strong>frame</strong>
  134. </td>
  135. <td class="description last">
  136. <p>A reference to the current node frame.</p>
  137. </td>
  138. </tr>
  139. </tbody>
  140. </table>
  141. <dl class="details">
  142. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#update">TempNode#update</a></dt>
  143. </dl>
  144. </div>
  145. <h3 class="name name-method" id="updateAfter" translate="no">.<a href="#updateAfter">updateAfter</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  146. <div class="method">
  147. <div class="description">
  148. <p>Overwritten to updated velocity specific uniforms.</p>
  149. </div>
  150. <table class="params">
  151. <tbody>
  152. <tr>
  153. <td class="name">
  154. <strong>frame</strong>
  155. </td>
  156. <td class="description last">
  157. <p>A reference to the current node frame.</p>
  158. </td>
  159. </tr>
  160. </tbody>
  161. </table>
  162. <dl class="details">
  163. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateAfter">TempNode#updateAfter</a></dt>
  164. </dl>
  165. </div>
  166. <h2 class="subsection-title">Source</h2>
  167. <p>
  168. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/VelocityNode.js" translate="no" target="_blank" rel="noopener">src/nodes/accessors/VelocityNode.js</a>
  169. </p>
  170. </article>
  171. </section>
  172. <script src="../scripts/linenumber.js"></script>
  173. <script src="../scripts/page.js"></script>
  174. </body>
  175. </html>
粤ICP备19079148号