ScreenNode.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ScreenNode - 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> → </p>
  13. <h1 translate="no">ScreenNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This node provides a collection of screen related metrics.
  17. Depending on <a href="ScreenNode.html#scope">ScreenNode#scope</a>, the nodes can represent
  18. resolution or viewport data as well as fragment or uv coordinates.</p></div>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="ScreenNode" translate="no">new <a href="#ScreenNode">ScreenNode</a><span class="signature">( scope : <span class="param-type">'coordinate' | 'viewport' | 'size' | 'uv' | 'dpr'</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new screen node.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name"><code>scope</code></td>
  32. <td class="description last"><p>The node's scope.</p></td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. </div>
  38. <h2 class="subsection-title">Properties</h2>
  39. <div class="member">
  40. <h3 class="name" id="_output" translate="no">.<a href="#_output">_output</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  41. <div class="description">
  42. <p>This output node.<br/>Default is <code>null</code>.</p>
  43. </div>
  44. </div>
  45. <div class="member">
  46. <h3 class="name" id="isViewportNode" translate="no">.<a href="#isViewportNode">isViewportNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  47. <div class="description">
  48. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  49. </div>
  50. </div>
  51. <div class="member">
  52. <h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'coordinate' | 'viewport' | 'size' | 'uv' | 'dpr'</span> </h3>
  53. <div class="description">
  54. <p>The node represents different metric depending on which scope is selected.</p>
  55. <ul>
  56. <li><code>ScreenNode.COORDINATE</code>: Window-relative coordinates of the current fragment according to WebGPU standards.</li>
  57. <li><code>ScreenNode.VIEWPORT</code>: The current viewport defined as a four-dimensional vector.</li>
  58. <li><code>ScreenNode.SIZE</code>: The dimensions of the current bound framebuffer.</li>
  59. <li><code>ScreenNode.UV</code>: Normalized coordinates.</li>
  60. <li><code>ScreenNode.DPR</code>: Device pixel ratio.</li>
  61. </ul>
  62. </div>
  63. </div>
  64. <h2 class="subsection-title">Methods</h2>
  65. <h3 class="name name-method" id="getNodeType" translate="no">.<a href="#getNodeType">getNodeType</a><span class="signature">()</span><span class="type-signature"> : 'float' | 'vec2' | 'vec4'</span> </h3>
  66. <div class="method">
  67. <div class="description">
  68. <p>This method is overwritten since the node type depends on the selected scope.</p>
  69. </div>
  70. <dl class="details">
  71. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getNodeType">Node#getNodeType</a></dt>
  72. </dl>
  73. <dl class="details">
  74. <dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
  75. </dl>
  76. </div>
  77. <h3 class="name name-method" id="getUpdateType" translate="no">.<a href="#getUpdateType">getUpdateType</a><span class="signature">()</span><span class="type-signature"> : <a href="global.html#NodeUpdateType">NodeUpdateType</a></span> </h3>
  78. <div class="method">
  79. <div class="description">
  80. <p>This method is overwritten since the node's update type depends on the selected scope.</p>
  81. </div>
  82. <dl class="details">
  83. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getUpdateType">Node#getUpdateType</a></dt>
  84. </dl>
  85. <dl class="details">
  86. <dt class="tag-returns"><strong>Returns:</strong> The update type.</dt>
  87. </dl>
  88. </div>
  89. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( frame : <span class="param-type">NodeFrame</span> )</span> </h3>
  90. <div class="method">
  91. <div class="description">
  92. <p><code>ScreenNode</code> implements <a href="Node.html#update">Node#update</a> to retrieve viewport and size information
  93. from the current renderer.</p>
  94. </div>
  95. <table class="params">
  96. <tbody>
  97. <tr>
  98. <td class="name"><code>frame</code></td>
  99. <td class="description last"><p>A reference to the current node frame.</p></td>
  100. </tr>
  101. </tbody>
  102. </table>
  103. <dl class="details">
  104. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#update">Node#update</a></dt>
  105. </dl>
  106. </div>
  107. <h2 class="subsection-title">Source</h2>
  108. <p>
  109. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ScreenNode.js" target="_blank" rel="noopener" translate="no">src/nodes/display/ScreenNode.js</a>
  110. </p>
  111. </article>
  112. </section>
  113. <script src="../scripts/linenumber.js"></script>
  114. <script src="../scripts/page.js"></script>
  115. </body>
  116. </html>
粤ICP备19079148号