|
@@ -10,7 +10,11 @@
|
|
<body>
|
|
<body>
|
|
<h1>[name]</h1>
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">A two dimensional surface that extends infinitely in 3d space.</div>
|
|
|
|
|
|
+ <div class="desc">
|
|
|
|
+ A two dimensional surface that extends infinitely in 3d space, defined by
|
|
|
|
+ a [link:https://en.wikipedia.org/wiki/Normal_(geometry) normal vector], and a
|
|
|
|
+ distance from the origin along the normal.
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
<h2>Constructor</h2>
|
|
@@ -18,8 +22,10 @@
|
|
|
|
|
|
<h3>[name]( [page:Vector3 normal], [page:Float constant] )</h3>
|
|
<h3>[name]( [page:Vector3 normal], [page:Float constant] )</h3>
|
|
<div>
|
|
<div>
|
|
- normal -- ([Page:Vector3]) normal vector defining the plane pointing towards the origin <br />
|
|
|
|
- constant -- ([Page:Float]) the negative distance from the origin to the plane along the normal vector
|
|
|
|
|
|
+ [page:Vector3 normal] - (optional) a [page:Vector3] defining the direction of the
|
|
|
|
+ plane. Default is *(1, 0, 0)*.<br />
|
|
|
|
+ [page:Float constant] - (optional) the negative distance from the origin to the plane along
|
|
|
|
+ the [page:Vector3 normal] vector. Default is *0*.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@@ -31,173 +37,156 @@
|
|
|
|
|
|
<h2>Methods</h2>
|
|
<h2>Methods</h2>
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <h3>[method:Plane normalize]() [page:Plane this]</h3>
|
|
|
|
|
|
+ <h3>[method:Plane applyMatrix4]( [page:Matrix4 matrix], [page:Matrix3 optionalNormalMatrix] )</h3>
|
|
<div>
|
|
<div>
|
|
- Normalizes the normal vector, and adjusts the constant value accordingly.
|
|
|
|
- </div>
|
|
|
|
|
|
+ [page:Matrix4 matrix] - the [Page:Matrix4] to apply <br />
|
|
|
|
+ [page:Matrix3 optionalNormalMatrix] - (optional) pre-computed normal [Page:Matrix3] of the Matrix4 to apply<br /><br />
|
|
|
|
|
|
- <h3>[method:Plane set]( [page:Vector3 normal], [page:Float constant] ) [page:Plane this]</h3>
|
|
|
|
- <div>
|
|
|
|
- normal -- [Page:Vector3] <br />
|
|
|
|
- constant -- [Page:Float]
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Sets the plane's values.
|
|
|
|
|
|
+ Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.<br />
|
|
|
|
+ If supplying an [page:Matrix3 optionalNormalMatrix], it can be created like so:
|
|
|
|
+ <code>
|
|
|
|
+ var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
|
|
|
|
+ </code>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Plane copy]( [page:Plane plane] ) [page:Plane this]</h3>
|
|
|
|
- <div>
|
|
|
|
- plane -- [page:Plane] to copy
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Copies the values of the passed plane to this plane.
|
|
|
|
- </div>
|
|
|
|
|
|
+ <h3>[method:Plane clone]()</h3>
|
|
|
|
+ <div>Returns a new plane with the same [page:.normal normal] and [page:.constant constant] as this one.</div>
|
|
|
|
|
|
- <h3>[method:Plane applyMatrix4]( [page:Matrix4 matrix], [page:Matrix3 optionalNormalMatrix] ) [page:Plane this]</h3>
|
|
|
|
- <div>
|
|
|
|
- matrix -- [Page:Matrix4] to apply <br />
|
|
|
|
- optionalNormalMatrix -- (optional) pre-computed normal [Page:Matrix3] of the Matrix4 to apply
|
|
|
|
- </div>
|
|
|
|
|
|
+ <h3>[method:Vector3 coplanarPoint]( [page:Vector3 optionalTarget] )</h3>
|
|
<div>
|
|
<div>
|
|
- Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.
|
|
|
|
- The second parameter is optional.
|
|
|
|
|
|
+ [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3].<br /><br />
|
|
|
|
|
|
- <code>
|
|
|
|
- var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix )
|
|
|
|
- </code>
|
|
|
|
|
|
+ Returns a [page:Vector3] coplanar to the plane, by calculating the projection of the
|
|
|
|
+ normal vector at the origin onto the plane.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Vector3 orthoPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
|
|
|
|
|
|
+ <h3>[method:Plane copy]( [page:Plane plane] )</h3>
|
|
<div>
|
|
<div>
|
|
- point -- [page:Vector3] <br />
|
|
|
|
- optionalTarget -- [page:Vector3]
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Returns a vector in the same direction as the Plane's normal, but the magnitude is passed point's original distance to the plane.
|
|
|
|
- </div>
|
|
|
|
|
|
+ [page:Plane plane] - the [page:Plane] to copy<br /><br />
|
|
|
|
|
|
- <h3>[method:Boolean intersectsLine]( [page:Line3 line] )</h3>
|
|
|
|
- <div>
|
|
|
|
- line -- [page:Line3]
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Tests whether a line segment intersects with the plane. (Do not mistake this for a collinear check.)
|
|
|
|
|
|
+ Copies the values of the passed plane's plane's [page:.normal normal] and [page:.constant constant]
|
|
|
|
+ properties to this plane.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Plane this]</h3>
|
|
|
|
- <div>
|
|
|
|
- box -- Box to check for intersection against.
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Determines whether or not this plane intersects *box*.
|
|
|
|
- </div>
|
|
|
|
|
|
+ <h3>[method:Float distanceToPoint]( [page:Vector3 point] )</h3>
|
|
|
|
+ <div>Returns the smallest distance from the [page:Vector3 point] to the plane.</div>
|
|
|
|
|
|
- <h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] ) [page:Plane this]</h3>
|
|
|
|
- <div>
|
|
|
|
- sphere -- Sphere to check for intersection against.
|
|
|
|
- </div>
|
|
|
|
|
|
+ <h3>[method:Float distanceToSphere]( [page:Sphere sphere] )</h3>
|
|
|
|
+ <div>Returns the smallest distance from the [page:Sphere sphere] to the plane.</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:Boolean equals]( [page:Plane plane] )</h3>
|
|
<div>
|
|
<div>
|
|
- Determines whether or not this plane intersects *sphere*.
|
|
|
|
|
|
+ Checks to see if two planes are equal (their [page:.normal normal] and
|
|
|
|
+ [page:.constant constant] properties match).
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>[method:Vector3 intersectLine]( [page:Line3 line], [page:Vector3 optionalTarget] ) or [page:undefined]</h3>
|
|
<h3>[method:Vector3 intersectLine]( [page:Line3 line], [page:Vector3 optionalTarget] ) or [page:undefined]</h3>
|
|
<div>
|
|
<div>
|
|
- line -- [page:Line3] <br />
|
|
|
|
- optionalTarget -- [page:Vector3]
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Returns the intersection point of the passed line and the plane. Returns undefined if the line does not intersect. Returns the line's starting point if the line is coplanar with the plane.
|
|
|
|
- </div>
|
|
|
|
|
|
+ [page:Line3 line] - the [page:Line3] to check for intersection.<br />
|
|
|
|
+ [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3].<br /><br />
|
|
|
|
|
|
- <h3>[method:Plane setFromNormalAndCoplanarPoint]( [page:Vector3 normal], [page:Vector3 point] ) [page:Vector3 this]</h3>
|
|
|
|
- <div>
|
|
|
|
- normal -- [page:Vector3] <br />
|
|
|
|
- point -- [page:Vector3]
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Sets the plane's values as defined by a normal and arbitrary coplanar point.
|
|
|
|
|
|
+ Returns the intersection point of the passed line and the plane. Returns undefined
|
|
|
|
+ if the line does not intersect. Returns the line's starting point if the line is
|
|
|
|
+ coplanar with the plane.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Plane clone]()</h3>
|
|
|
|
|
|
+ <h3>[method:Boolean intersectsBox]( [page:Box3 box] )</h3>
|
|
<div>
|
|
<div>
|
|
- Returns a new copy of this plane.
|
|
|
|
- </div>
|
|
|
|
|
|
+ [page:Box3 box] - the [page:Box3] to check for intersection.<br /><br />
|
|
|
|
|
|
- <h3>[method:Float distanceToPoint]( [page:Vector3 point] )</h3>
|
|
|
|
- <div>
|
|
|
|
- point -- [page:Vector3]
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Returns the smallest distance from the point to the plane.
|
|
|
|
|
|
+ Determines whether or not this plane intersects [page:Box3 box].
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Boolean equals]( [page:Plane plane] )</h3>
|
|
|
|
- <div>
|
|
|
|
- plane -- [page:Planen]
|
|
|
|
- </div>
|
|
|
|
|
|
+ <h3>[method:Boolean intersectsLine]( [page:Line3 line] )</h3>
|
|
<div>
|
|
<div>
|
|
- Checks to see if two planes are equal (their normals and constants match)
|
|
|
|
- </div>
|
|
|
|
|
|
+ [page:Line3 line] - the [page:Line3] to check for intersection.<br /><br />
|
|
|
|
|
|
- <h3>[method:Plane setComponents]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] ) [page:Plane this]</h3>
|
|
|
|
- <div>
|
|
|
|
- x -- [page:Float] x of the normal vector <br />
|
|
|
|
- y -- [page:Float] y of the normal vector<br />
|
|
|
|
- z -- [page:Float] z of the normal vector<br />
|
|
|
|
- w -- [page:Float] distance of the plane from the origin along the normal vector
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Set the individual components that make up the plane.
|
|
|
|
|
|
+ Tests whether a line segment intersects with (passes through) the plane.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Float distanceToSphere]( [page:Sphere sphere] )</h3>
|
|
|
|
|
|
+ <h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] )</h3>
|
|
<div>
|
|
<div>
|
|
- sphere -- [Page:Sphere]
|
|
|
|
|
|
+ [page:Sphere sphere] - the [page:Sphere] to check for intersection.<br /><br />
|
|
|
|
+
|
|
|
|
+ Determines whether or not this plane intersects [page:Sphere sphere].
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:Plane negate]()</h3>
|
|
<div>
|
|
<div>
|
|
- Returns the smallest distance from an edge of the sphere to the plane.
|
|
|
|
|
|
+ Negates both the normal vector and constant, effectively mirroring the plane across
|
|
|
|
+ the origin.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Plane setFromCoplanarPoints]( [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] ) [page:Plane this]</h3>
|
|
|
|
|
|
+ <h3>[method:Plane normalize]()</h3>
|
|
<div>
|
|
<div>
|
|
- a -- [page:Vector3] <br />
|
|
|
|
- b -- [page:Vector3] <br />
|
|
|
|
- c -- [page:Vector3]
|
|
|
|
|
|
+ Normalizes the [page:.normal normal] vector, and adjusts the [page:.constant constant]
|
|
|
|
+ value accordingly.
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:Vector3 orthoPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
|
|
<div>
|
|
<div>
|
|
- Defines the plane based on the 3 provided points. The winding order is counter clockwise, and determines which direction the normal will point.
|
|
|
|
|
|
+ [page:Vector3 point] - [page:Vector3] <br />
|
|
|
|
+ [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied
|
|
|
|
+ into this [page:Vector3].<br /><br />
|
|
|
|
+
|
|
|
|
+ Returns a vector in the same direction as the Plane's normal, but with magnitude
|
|
|
|
+ equal to the passed point's original distance to the plane.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>[method:Vector3 projectPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
|
|
<h3>[method:Vector3 projectPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
|
|
<div>
|
|
<div>
|
|
- point -- [page:Vector3] <br />
|
|
|
|
- optionalTarget -- [page:Vector3]
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- Projects a point onto the plane. The projected point is the closest point on the plane to the passed point, so a line drawn from the projected point and the passed point would be orthogonal to the plane.
|
|
|
|
|
|
+ [page:Vector3 point] - the [page:Vector3] to project onto the plane.<br />
|
|
|
|
+ [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3].<br /><br />
|
|
|
|
+
|
|
|
|
+ Projects a [page:Vector3 point] onto the plane. The projected point is the closest
|
|
|
|
+ point on the plane to the passed point, so a line drawn from the projected point
|
|
|
|
+ and the passed point would be orthogonal to the plane.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Plane negate]() [page:Plane this]</h3>
|
|
|
|
|
|
+ <h3>[method:Plane set]( [page:Vector3 normal], [page:Float constant] )</h3>
|
|
<div>
|
|
<div>
|
|
- Negates both the normal vector and constant, effectively mirroring the plane across the origin.
|
|
|
|
|
|
+ [page:Vector3 normal] - a [page:Vector3] defining the direction of the plane.<br />
|
|
|
|
+ [page:Float constant] - (optional) the negative distance from the origin to the plane along
|
|
|
|
+ the [page:Vector3 normal] vector. Default is *0*.<br /><br />
|
|
|
|
+
|
|
|
|
+ Sets the plane's [page:.normal normal] and [page:.constant constant] properties.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Plane translate]( [page:Vector3 offset] ) [page:Plane this]</h3>
|
|
|
|
|
|
+ <h3>[method:Plane setComponents]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] )</h3>
|
|
<div>
|
|
<div>
|
|
- offset -- [page:Vector3]
|
|
|
|
|
|
+ [page:Float x] - x value of the normal vector.<br />
|
|
|
|
+ [page:Float y] - y value of the normal vector.<br />
|
|
|
|
+ [page:Float z] - z value of the normal vector.<br />
|
|
|
|
+ [page:Float w] - the value of the plane's [page:.constant constant] property.<br /><br />
|
|
|
|
+
|
|
|
|
+ Set the individual components that make up the plane.
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:Plane setFromCoplanarPoints]( [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] )</h3>
|
|
<div>
|
|
<div>
|
|
- Translates the plane the distance defined by the vector. Note that this only affects the constant (distance from origin) and will not affect the normal vector.
|
|
|
|
|
|
+ [page:Vector3 a] - first point on the plane.<br />
|
|
|
|
+ [page:Vector3 a] - second point on the plane.<br />
|
|
|
|
+ [page:Vector3 a] - third point on the plane.<br /><br />
|
|
|
|
+
|
|
|
|
+ Defines the plane based on the 3 provided points. The winding order is counter
|
|
|
|
+ clockwise, and determines which direction the [page:.normal normal] will point.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Vector3 coplanarPoint]( [page:Vector3 optionalTarget] )</h3>
|
|
|
|
|
|
+ <h3>[method:Plane setFromNormalAndCoplanarPoint]( [page:Vector3 normal], [page:Vector3 point] ) [page:Vector3 this]</h3>
|
|
<div>
|
|
<div>
|
|
- optionalTarget -- [page:Vector3]
|
|
|
|
|
|
+ [page:Vector3 normal] - a [page:Vector3] defining the direction of the plane.<br />
|
|
|
|
+ [page:Vector3 point] - [page:Vector3]<br /><br />
|
|
|
|
+
|
|
|
|
+ Sets the plane's properties as defined by a [page:Vector3 normal] and an arbitrary coplanar [page:Vector3 point].
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:Plane translate]( [page:Vector3 offset] )</h3>
|
|
<div>
|
|
<div>
|
|
- Returns a coplanar point. (The projection of the normal vector at the origin onto the plane.)
|
|
|
|
|
|
+ [page:Vector3 offset] - the amount to move the plane by.<br /><br />
|
|
|
|
+
|
|
|
|
+ Translates the plane the distance defined by the [page:Vector3 offset] vector.
|
|
|
|
+ Note that this only affects the constant (distance from origin) and will not affect
|
|
|
|
+ the normal vector.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h2>Source</h2>
|
|
<h2>Source</h2>
|