2
0

SphericalHarmonics3.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. Represents a third-order spherical harmonics (SH). Light probes use this
  13. class to encode lighting information.
  14. </p>
  15. <h2>Constructor</h2>
  16. <h3>[name]()</h3>
  17. <p>Creates a new instance of [name].</p>
  18. <h2>Properties</h2>
  19. <h3>[property:Array coefficients]</h3>
  20. <p>
  21. An array holding the (9) SH coefficients. A single coefficient is
  22. represented as an instance of [page:Vector3].
  23. </p>
  24. <h3>[property:Boolean isSphericalHarmonics3]</h3>
  25. <p>Read-only flag to check if a given object is of type [name].</p>
  26. <h2>Methods</h2>
  27. <h3>[method:this add]( [param:SphericalHarmonics3 sh] )</h3>
  28. <p>
  29. [page:SphericalHarmonics3 sh] - The SH to add.<br /><br />
  30. Adds the given SH to this instance.
  31. </p>
  32. <h3>
  33. [method:this addScaledSH]( [param:SphericalHarmonics3 sh], [param:Number scale] )
  34. </h3>
  35. <p>
  36. [page:SphericalHarmonics3 sh] - The SH to add.<br />
  37. [page:Number scale] - The scale factor.<br /><br />
  38. A convenience method for performing [page:.add]() and [page:.scale]() at
  39. once.
  40. </p>
  41. <h3>[method:SphericalHarmonics3 clone]()</h3>
  42. <p>Returns a new instance of [name] with equal coefficients.</p>
  43. <h3>[method:this copy]( [param:SphericalHarmonics3 sh] )</h3>
  44. <p>
  45. [page:SphericalHarmonics3 sh] - The SH to copy.<br /><br />
  46. Copies the given SH to this instance.
  47. </p>
  48. <h3>[method:Boolean equals]( [param:SphericalHarmonics3 sh] )</h3>
  49. <p>
  50. [page:SphericalHarmonics3 sh] - The SH to compare with.<br /><br />
  51. Returns true if the given SH and this instance have equal coefficients.
  52. </p>
  53. <h3>
  54. [method:this fromArray]( [param:Array array], [param:Number offset] )
  55. </h3>
  56. <p>
  57. [page:Array array] - The array holding the numbers of the SH
  58. coefficients.<br />
  59. [page:Number offset] - (optional) The array offset.<br /><br />
  60. Sets the coefficients of this instance from the given array.
  61. </p>
  62. <h3>
  63. [method:Vector3 getAt]( [param:Vector3 normal], [param:Vector3 target] )
  64. </h3>
  65. <p>
  66. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  67. [page:Vector3 target] - The result vector.<br /><br />
  68. Returns the radiance in the direction of the given normal.
  69. </p>
  70. <h3>
  71. [method:Vector3 getIrradianceAt]( [param:Vector3 normal], [param:Vector3 target] )
  72. </h3>
  73. <p>
  74. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  75. [page:Vector3 target] - The result vector.<br /><br />
  76. Returns the irradiance (radiance convolved with cosine lobe) in the
  77. direction of the given normal.
  78. </p>
  79. <h3>
  80. [method:this lerp]( [param:SphericalHarmonics3 sh], [param:Number alpha] )
  81. </h3>
  82. <p>
  83. [page:SphericalHarmonics3 sh] - The SH to interpolate with.<br />
  84. [page:Number alpha] - The alpha factor.<br /><br />
  85. Linear interpolates between the given SH and this instance by the given
  86. alpha factor.
  87. </p>
  88. <h3>[method:this scale]( [param:Number scale] )</h3>
  89. <p>
  90. [page:Number scale] - The scale factor.<br /><br />
  91. Scales this SH by the given scale factor.
  92. </p>
  93. <h3>[method:this set]( [param:Array coefficients] )</h3>
  94. <p>
  95. [page:Array coefficients] - An array of SH coefficients.<br /><br />
  96. Sets the given SH coefficients to this instance.
  97. </p>
  98. <h3>
  99. [method:Array toArray]( [param:Array array], [param:Number offset] )
  100. </h3>
  101. <p>
  102. [page:Array array] - (optional) The target array.<br />
  103. [page:Number offset] - (optional) The array offset.<br /><br />
  104. Returns an array with the coefficients, or copies them into the provided
  105. array. The coefficients are represented as numbers.
  106. </p>
  107. <h3>[method:this zero]()</h3>
  108. <p>Sets all SH coefficients to `0`.</p>
  109. <h2>Static Methods</h2>
  110. <h3>
  111. [method:undefined getBasisAt]( [param:Vector3 normal], [param:Array shBasis] )
  112. </h3>
  113. <p>
  114. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  115. [page:Array shBasis] - The resulting SH basis.<br /><br />
  116. Computes the SH basis for the given normal vector.
  117. </p>
  118. <h2>Source</h2>
  119. <p>
  120. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  121. </p>
  122. </body>
  123. </html>