FogExp2.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 | Color</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"><code>color</code></td>
  35. <td class="description last"><p>The fog's color.</p></td>
  36. </tr>
  37. <tr>
  38. <td class="name"><code>density</code></td>
  39. <td class="description last"><p>Defines how fast the fog will grow dense.<br/>Default is <code>0.00025</code>.</p></td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Properties</h2>
  46. <div class="member">
  47. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  48. <div class="description">
  49. <p>The fog's color.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="density" translate="no">.<a href="#density">density</a><span class="type-signature"> : number</span> </h3>
  54. <div class="description">
  55. <p>Defines how fast the fog will grow dense.<br/>Default is <code>0.00025</code>.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <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>
  60. <div class="description">
  61. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  66. <div class="description">
  67. <p>The name of the fog.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <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>
  72. <div class="method">
  73. <div class="description">
  74. <p>Returns a new fog with copied values from this instance.</p>
  75. </div>
  76. <dl class="details">
  77. <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
  78. </dl>
  79. </div>
  80. <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>
  81. <div class="method">
  82. <div class="description">
  83. <p>Serializes the fog into JSON.</p>
  84. </div>
  85. <table class="params">
  86. <tbody>
  87. <tr>
  88. <td class="name"><code>meta</code></td>
  89. <td class="description last"><p>An optional value holding meta information about the serialization.</p></td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <dl class="details">
  94. <dt class="tag-returns"><strong>Returns:</strong> A JSON object representing the serialized fog</dt>
  95. </dl>
  96. </div>
  97. <h2 class="subsection-title">Source</h2>
  98. <p>
  99. <a href="https://github.com/mrdoob/three.js/blob/master/src/scenes/FogExp2.js" target="_blank" rel="noopener" translate="no">src/scenes/FogExp2.js</a>
  100. </p>
  101. </article>
  102. </section>
  103. <script src="../scripts/linenumber.js"></script>
  104. <script src="../scripts/page.js"></script>
  105. </body>
  106. </html>
粤ICP备19079148号