ScreenNode.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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">
  32. <strong>scope</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The node's scope.</p>
  36. </td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. <h2 class="subsection-title">Properties</h2>
  43. <div class="member">
  44. <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>
  45. <div class="description">
  46. <p>This flag can be used for type testing.</p>
  47. <p>Default is <code>true</code>.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'coordinate' | 'viewport' | 'size' | 'uv' | 'dpr'</span> </h3>
  52. <div class="description">
  53. <p>The node represents different metric depending on which scope is selected.</p>
  54. <ul>
  55. <li><code>ScreenNode.COORDINATE</code>: Window-relative coordinates of the current fragment according to WebGPU standards.</li>
  56. <li><code>ScreenNode.VIEWPORT</code>: The current viewport defined as a four-dimensional vector.</li>
  57. <li><code>ScreenNode.SIZE</code>: The dimensions of the current bound framebuffer.</li>
  58. <li><code>ScreenNode.UV</code>: Normalized coordinates.</li>
  59. <li><code>ScreenNode.DPR</code>: Device pixel ratio.</li>
  60. </ul>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Methods</h2>
  64. <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>
  65. <div class="method">
  66. <div class="description">
  67. <p>This method is overwritten since the node type depends on the selected scope.</p>
  68. </div>
  69. <dl class="details">
  70. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getNodeType">Node#getNodeType</a></dt>
  71. </dl>
  72. <dl class="details">
  73. <dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
  74. </dl>
  75. </div>
  76. <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>
  77. <div class="method">
  78. <div class="description">
  79. <p>This method is overwritten since the node's update type depends on the selected scope.</p>
  80. </div>
  81. <dl class="details">
  82. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getUpdateType">Node#getUpdateType</a></dt>
  83. </dl>
  84. <dl class="details">
  85. <dt class="tag-returns"><strong>Returns:</strong> The update type.</dt>
  86. </dl>
  87. </div>
  88. <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>
  89. <div class="method">
  90. <div class="description">
  91. <p><code>ScreenNode</code> implements <a href="Node.html#update">Node#update</a> to retrieve viewport and size information
  92. from the current renderer.</p>
  93. </div>
  94. <table class="params">
  95. <tbody>
  96. <tr>
  97. <td class="name">
  98. <strong>frame</strong>
  99. </td>
  100. <td class="description last">
  101. <p>A reference to the current node frame.</p>
  102. </td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. <dl class="details">
  107. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#update">Node#update</a></dt>
  108. </dl>
  109. </div>
  110. <h2 class="subsection-title">Source</h2>
  111. <p>
  112. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ScreenNode.js" translate="no" target="_blank" rel="noopener">src/nodes/display/ScreenNode.js</a>
  113. </p>
  114. </article>
  115. </section>
  116. <script src="../scripts/linenumber.js"></script>
  117. <script src="../scripts/page.js"></script>
  118. </body>
  119. </html>
粤ICP备19079148号