FogExp2.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>FogExp2 - 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. <h1 translate="no">FogExp2</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This class can be used to define an exponential squared fog,
  16. which gives a clear view near the camera and a faster than exponentially
  17. densening fog farther from the camera.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const scene = new THREE.Scene();
  20. scene.fog = new THREE.FogExp2( 0xcccccc, 0.002 );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="FogExp2" translate="no">new <a href="#FogExp2">FogExp2</a><span class="signature">( color : <span class="param-type">number | <a href="Color.html">Color</a></span>, density : <span class="param-type">number</span> )</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new fog.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name">
  35. <strong>color</strong>
  36. </td>
  37. <td class="description last">
  38. <p>The fog's color.</p>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td class="name">
  43. <strong>density</strong>
  44. </td>
  45. <td class="description last">
  46. <p>Defines how fast the fog will grow dense.</p>
  47. <p>Default is <code>0.00025</code>.</p>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  57. <div class="description">
  58. <p>The fog's color.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="density" translate="no">.<a href="#density">density</a><span class="type-signature"> : number</span> </h3>
  63. <div class="description">
  64. <p>Defines how fast the fog will grow dense.</p>
  65. <p>Default is <code>0.00025</code>.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="isFogExp2" translate="no">.<a href="#isFogExp2">isFogExp2</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  70. <div class="description">
  71. <p>This flag can be used for type testing.</p>
  72. <p>Default is <code>true</code>.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  77. <div class="description">
  78. <p>The name of the fog.</p>
  79. </div>
  80. </div>
  81. <h2 class="subsection-title">Methods</h2>
  82. <h3 class="name name-method" id="clone" translate="no">.<a href="#clone">clone</a><span class="signature">()</span><span class="type-signature"> : <a href="FogExp2.html">FogExp2</a></span> </h3>
  83. <div class="method">
  84. <div class="description">
  85. <p>Returns a new fog with copied values from this instance.</p>
  86. </div>
  87. <dl class="details">
  88. <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
  89. </dl>
  90. </div>
  91. <h3 class="name name-method" id="toJSON" translate="no">.<a href="#toJSON">toJSON</a><span class="signature">( meta : <span class="param-type">Object | string</span> )</span><span class="type-signature"> : Object</span> </h3>
  92. <div class="method">
  93. <div class="description">
  94. <p>Serializes the fog into JSON.</p>
  95. </div>
  96. <table class="params">
  97. <tbody>
  98. <tr>
  99. <td class="name">
  100. <strong>meta</strong>
  101. </td>
  102. <td class="description last">
  103. <p>An optional value holding meta information about the serialization.</p>
  104. </td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <dl class="details">
  109. <dt class="tag-returns"><strong>Returns:</strong> A JSON object representing the serialized fog</dt>
  110. </dl>
  111. </div>
  112. <h2 class="subsection-title">Source</h2>
  113. <p>
  114. <a href="https://github.com/mrdoob/three.js/blob/master/src/scenes/FogExp2.js" translate="no" target="_blank" rel="noopener">src/scenes/FogExp2.js</a>
  115. </p>
  116. </article>
  117. </section>
  118. <script src="../scripts/linenumber.js"></script>
  119. <script src="../scripts/page.js"></script>
  120. </body>
  121. </html>
粤ICP备19079148号