Plane.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. A two dimensional surface that extends infinitely in 3d space, defined by
  14. a [link:https://en.wikipedia.org/wiki/Normal_(geometry) normal vector], and a
  15. distance from the origin along the normal.
  16. </div>
  17. <h2>Constructor</h2>
  18. <h3>[name]( [page:Vector3 normal], [page:Float constant] )</h3>
  19. <div>
  20. [page:Vector3 normal] - (optional) a [page:Vector3] defining the direction of the
  21. plane. Default is *(1, 0, 0)*.<br />
  22. [page:Float constant] - (optional) the negative distance from the origin to the plane along
  23. the [page:Vector3 normal] vector. Default is *0*.
  24. </div>
  25. <h2>Properties</h2>
  26. <h3>[property:Vector3 normal]</h3>
  27. <h3>[property:Float constant]</h3>
  28. <h2>Methods</h2>
  29. <h3>[method:Plane applyMatrix4]( [page:Matrix4 matrix], [page:Matrix3 optionalNormalMatrix] )</h3>
  30. <div>
  31. [page:Matrix4 matrix] - the [Page:Matrix4] to apply.<br />
  32. [page:Matrix3 optionalNormalMatrix] - (optional) pre-computed normal [Page:Matrix3] of the Matrix4 being applied.<br /><br />
  33. Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.<br />
  34. If supplying an [page:Matrix3 optionalNormalMatrix], it can be created like so:
  35. <code>
  36. var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
  37. </code>
  38. </div>
  39. <h3>[method:Plane clone]()</h3>
  40. <div>Returns a new plane with the same [page:.normal normal] and [page:.constant constant] as this one.</div>
  41. <h3>[method:Vector3 coplanarPoint]( [page:Vector3 optionalTarget] )</h3>
  42. <div>
  43. [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
  44. otherwise a new [page:Vector3] will be created.<br /><br />
  45. Returns a [page:Vector3] coplanar to the plane, by calculating the projection of the
  46. normal vector at the origin onto the plane.
  47. </div>
  48. <h3>[method:Plane copy]( [page:Plane plane] )</h3>
  49. <div>
  50. Copies the values of the passed plane's [page:.normal normal] and [page:.constant constant]
  51. properties to this plane.
  52. </div>
  53. <h3>[method:Float distanceToPoint]( [page:Vector3 point] )</h3>
  54. <div>Returns the smallest distance from the [page:Vector3 point] to the plane.</div>
  55. <h3>[method:Float distanceToSphere]( [page:Sphere sphere] )</h3>
  56. <div>Returns the smallest distance from the [page:Sphere sphere] to the plane.</div>
  57. <h3>[method:Boolean equals]( [page:Plane plane] )</h3>
  58. <div>
  59. Checks to see if two planes are equal (their [page:.normal normal] and
  60. [page:.constant constant] properties match).
  61. </div>
  62. <h3>[method:Vector3 intersectLine]( [page:Line3 line], [page:Vector3 optionalTarget] ) or [page:undefined]</h3>
  63. <div>
  64. [page:Line3 line] - the [page:Line3] to check for intersection.<br />
  65. [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
  66. otherwise a new [page:Vector3] will be created.<br /><br />
  67. Returns the intersection point of the passed line and the plane. Returns undefined
  68. if the line does not intersect. Returns the line's starting point if the line is
  69. coplanar with the plane.
  70. </div>
  71. <h3>[method:Boolean intersectsBox]( [page:Box3 box] )</h3>
  72. <div>
  73. [page:Box3 box] - the [page:Box3] to check for intersection.<br /><br />
  74. Determines whether or not this plane intersects [page:Box3 box].
  75. </div>
  76. <h3>[method:Boolean intersectsLine]( [page:Line3 line] )</h3>
  77. <div>
  78. [page:Line3 line] - the [page:Line3] to check for intersection.<br /><br />
  79. Tests whether a line segment intersects with (passes through) the plane.
  80. </div>
  81. <h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] )</h3>
  82. <div>
  83. [page:Sphere sphere] - the [page:Sphere] to check for intersection.<br /><br />
  84. Determines whether or not this plane intersects [page:Sphere sphere].
  85. </div>
  86. <h3>[method:Plane negate]()</h3>
  87. <div>
  88. Negates both the normal vector and constant, effectively mirroring the plane across
  89. the origin.
  90. </div>
  91. <h3>[method:Plane normalize]()</h3>
  92. <div>
  93. Normalizes the [page:.normal normal] vector, and adjusts the [page:.constant constant]
  94. value accordingly.
  95. </div>
  96. <h3>[method:Vector3 orthoPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
  97. <div>
  98. [page:Vector3 point] - [page:Vector3] <br />
  99. [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied
  100. into this [page:Vector3], otherwise a new [page:Vector3] will be created.<br /><br />
  101. Returns a vector in the same direction as the Plane's normal, but with magnitude
  102. equal to the passed point's original distance to the plane.
  103. </div>
  104. <h3>[method:Vector3 projectPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
  105. <div>
  106. [page:Vector3 point] - the [page:Vector3] to project onto the plane.<br />
  107. [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
  108. otherwise a new [page:Vector3] will be created.<br /><br />
  109. Projects a [page:Vector3 point] onto the plane. The projected point is the closest
  110. point on the plane to the passed point, so a line drawn from the projected point
  111. and the passed point would be orthogonal to the plane.
  112. </div>
  113. <h3>[method:Plane set]( [page:Vector3 normal], [page:Float constant] )</h3>
  114. <div>
  115. [page:Vector3 normal] - a [page:Vector3] defining the direction of the plane.<br />
  116. [page:Float constant] - (optional) the negative distance from the origin to the plane along
  117. the [page:Vector3 normal] vector. Default is *0*.<br /><br />
  118. Sets the plane's [page:.normal normal] and [page:.constant constant] properties.
  119. </div>
  120. <h3>[method:Plane setComponents]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] )</h3>
  121. <div>
  122. [page:Float x] - x value of the normal vector.<br />
  123. [page:Float y] - y value of the normal vector.<br />
  124. [page:Float z] - z value of the normal vector.<br />
  125. [page:Float w] - the value of the plane's [page:.constant constant] property.<br /><br />
  126. Set the individual components that make up the plane.
  127. </div>
  128. <h3>[method:Plane setFromCoplanarPoints]( [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] )</h3>
  129. <div>
  130. [page:Vector3 a] - first point on the plane.<br />
  131. [page:Vector3 a] - second point on the plane.<br />
  132. [page:Vector3 a] - third point on the plane.<br /><br />
  133. Defines the plane based on the 3 provided points. The winding order is counter
  134. clockwise, and determines which direction the [page:.normal normal] will point.
  135. </div>
  136. <h3>[method:Plane setFromNormalAndCoplanarPoint]( [page:Vector3 normal], [page:Vector3 point] ) [page:Vector3 this]</h3>
  137. <div>
  138. [page:Vector3 normal] - a [page:Vector3] defining the direction of the plane.<br />
  139. [page:Vector3 point] - [page:Vector3]<br /><br />
  140. Sets the plane's properties as defined by a [page:Vector3 normal] and an arbitrary coplanar [page:Vector3 point].
  141. </div>
  142. <h3>[method:Plane translate]( [page:Vector3 offset] )</h3>
  143. <div>
  144. [page:Vector3 offset] - the amount to move the plane by.<br /><br />
  145. Translates the plane the distance defined by the [page:Vector3 offset] vector.
  146. Note that this only affects the constant (distance from origin) and will not affect
  147. the normal vector.
  148. </div>
  149. <h2>Source</h2>
  150. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  151. </body>
  152. </html>