|
@@ -11,162 +11,153 @@
|
|
|
<h1>平面([name])</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
- A two dimensional surface that extends infinitely in 3d space, represented in [link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]
|
|
|
- by a unit length normal vector and a constant.
|
|
|
+ 在三维空间中无限延伸的二维平面,平面方程用单位长度的法向量和常数表示为海塞法向量[link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]形式。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Constructor</h2>
|
|
|
+ <h2>构造器(Constructor)</h2>
|
|
|
|
|
|
|
|
|
<h3>[name]( [param:Vector3 normal], [param:Float constant] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 normal] - (optional) a unit length [page:Vector3] defining the normal of the plane. Default is *(1, 0, 0)*.<br />
|
|
|
- [page:Float constant] - (optional) the signed distance from the origin to the plane. Default is *0*.
|
|
|
+ [page:Vector3 normal] - (可选参数) 定义单位长度的平面法向量[page:Vector3]。默认值为 *(1, 0, 0)*。<br />
|
|
|
+ [page:Float constant] - (可选参数) 从原点到平面的有符号距离。 默认值为 *0*.
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Properties</h2>
|
|
|
+ <h2>属性(Properties)</h2>
|
|
|
|
|
|
<h3>[property:Vector3 normal]</h3>
|
|
|
|
|
|
<h3>[property:Float constant]</h3>
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
+ <h2>方法(Methods)</h2>
|
|
|
|
|
|
<h3>[method:Plane applyMatrix4]( [param:Matrix4 matrix], [param:Matrix3 optionalNormalMatrix] )</h3>
|
|
|
<p>
|
|
|
- [page:Matrix4 matrix] - the [Page:Matrix4] to apply.<br />
|
|
|
- [page:Matrix3 optionalNormalMatrix] - (optional) pre-computed normal [Page:Matrix3] of the Matrix4 being applied.<br /><br />
|
|
|
+ [page:Matrix4 matrix] - 要应用的四位矩阵([Page:Matrix4])。<br />
|
|
|
+ [page:Matrix3 optionalNormalMatrix] - (可选参数) 预先计算好的上述Matrix4参数的法线矩阵 [Page:Matrix3]。<br /><br />
|
|
|
|
|
|
- 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:
|
|
|
+ 在平面上应用矩阵。矩阵必须是仿射齐次变换。<br />
|
|
|
+ 如果提供一个optionalNormalMatrix,可以这样创建:
|
|
|
<code>
|
|
|
var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
|
|
|
</code>
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane clone]()</h3>
|
|
|
- <p>Returns a new plane with the same [page:.normal normal] and [page:.constant constant] as this one.</p>
|
|
|
+ <p>返回一个与当前平面有相同法线 [page:.normal normal],常量 [page:.constant constant] 距离的平面。</p>
|
|
|
|
|
|
<h3>[method:Vector3 coplanarPoint]( [param:Vector3 target] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
|
|
|
+ [page:Vector3 target] — 结果会拷贝到该向量中。<br /><br />
|
|
|
|
|
|
- Returns a [page:Vector3] coplanar to the plane, by calculating the projection of the
|
|
|
- normal vector at the origin onto the plane.
|
|
|
+ 返回一个共面点,通过原点的法向量在平面上投影算得。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane copy]( [param:Plane plane] )</h3>
|
|
|
<p>
|
|
|
- Copies the values of the passed plane's [page:.normal normal] and [page:.constant constant]
|
|
|
- properties to this plane.
|
|
|
+ 拷贝给定平面,将其中的法线 [page:.normal normal],距离常量 [page:.constant constant]属性拷贝给该对象。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Float distanceToPoint]( [param:Vector3 point] )</h3>
|
|
|
- <p>Returns the signed distance from the [page:Vector3 point] to the plane.</p>
|
|
|
+ <p>返回点[page:Vector3 point]到平面的有符号距离。</p>
|
|
|
|
|
|
<h3>[method:Float distanceToSphere]( [param:Sphere sphere] )</h3>
|
|
|
- <p>Returns the signed distance from the [page:Sphere sphere] to the plane.</p>
|
|
|
+ <p>返回球面 [page:Sphere sphere] 的边缘到平面的最短距离。</p>
|
|
|
|
|
|
<h3>[method:Boolean equals]( [param:Plane plane] )</h3>
|
|
|
<p>
|
|
|
- Checks to see if two planes are equal (their [page:.normal normal] and
|
|
|
- [page:.constant constant] properties match).
|
|
|
+ 检查两个平面是否相等。(法线 [page:.normal normal] 以及常量 [page:.constant constant] 都相同)。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] )</h3>
|
|
|
<p>
|
|
|
- [page:Line3 line] - the [page:Line3] to check for intersection.<br />
|
|
|
- [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
|
|
|
+ [page:Line3 line] - 检测是否相交的三维几何线段 [page:Line3]。<br />
|
|
|
+ [page:Vector3 target] — 结果将会写入该向量中。<br /><br />
|
|
|
|
|
|
- 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.
|
|
|
+ 返回给定线段和平面的交点。如果不相交则返回undefined。如果线与平面共面,则返回该线段的起始点。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
|
|
|
<p>
|
|
|
- [page:Box3 box] - the [page:Box3] to check for intersection.<br /><br />
|
|
|
+ [page:Box3 box] - 检查是否相交的包围盒 [page:Box3]。<br /><br />
|
|
|
|
|
|
- Determines whether or not this plane intersects [page:Box3 box].
|
|
|
+ 确定该平面是否与给定3d包围盒[page:Box3]相交。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Boolean intersectsLine]( [param:Line3 line] )</h3>
|
|
|
<p>
|
|
|
- [page:Line3 line] - the [page:Line3] to check for intersection.<br /><br />
|
|
|
+ [page:Line3 line] - 检查是否相交的三维线段 [page:Line3]。<br /><br />
|
|
|
|
|
|
- Tests whether a line segment intersects with (passes through) the plane.
|
|
|
+ 测试线段是否与平面相交。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
|
|
|
<p>
|
|
|
- [page:Sphere sphere] - the [page:Sphere] to check for intersection.<br /><br />
|
|
|
+ [page:Sphere sphere] - 检查是否相交的球体 [page:Sphere]。<br /><br />
|
|
|
|
|
|
- Determines whether or not this plane intersects [page:Sphere sphere].
|
|
|
+ 确定该平面是否与给定球体 [page:Sphere] 相交。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane negate]()</h3>
|
|
|
<p>
|
|
|
- Negates both the normal vector and the constant.
|
|
|
+ 将法向量与常量求反(乘以-1)。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane normalize]()</h3>
|
|
|
<p>
|
|
|
- Normalizes the [page:.normal normal] vector, and adjusts the [page:.constant constant]
|
|
|
- value accordingly.
|
|
|
+ 归一化法向量 [page:.normal normal] ,并相应的调整常量 [page:.constant constant]数值。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Vector3 projectPoint]( [param:Vector3 point], [param:Vector3 target] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 point] - the [page:Vector3] to project onto the plane.<br />
|
|
|
- [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
|
|
|
+ [page:Vector3 point] - 需要投射到该平面的点。<br />
|
|
|
+ [page:Vector3 target] — 在该平面上离投射点最近的点。<br /><br />
|
|
|
|
|
|
- Projects a [page:Vector3 point] onto the plane.
|
|
|
+ 将一个点[page:Vector3 point]投射到该平面上。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane set]( [param:Vector3 normal], [param:Float constant] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 normal] - a unit length [page:Vector3] defining the normal of the plane.<br />
|
|
|
- [page:Float constant] - the signed distance from the origin to the plane. Default is *0*.<br /><br />
|
|
|
+ [page:Vector3 normal] - 单位长度的向量表示平面的法向量。<br />
|
|
|
+ [page:Float constant] - 原点到平面有符号距离。默认值为 *0*。<br /><br />
|
|
|
|
|
|
- Sets the plane's [page:.normal normal] and [page:.constant constant] properties.
|
|
|
+ 设置平面 [page:.normal normal] 的法线和常量 [page:.constant constant] 属性值。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane setComponents]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] )</h3>
|
|
|
<p>
|
|
|
- [page:Float x] - x value of the unit length normal vector.<br />
|
|
|
- [page:Float y] - y value of the unit length normal vector.<br />
|
|
|
- [page:Float z] - z value of the unit length normal vector.<br />
|
|
|
- [page:Float w] - the value of the plane's [page:.constant constant] property.<br /><br />
|
|
|
+ [page:Float x] - 单位长度法向量的x值。<br />
|
|
|
+ [page:Float y] - 单位长度法向量的y值。<br />
|
|
|
+ [page:Float z] - 单位长度法向量的z值。<br />
|
|
|
+ [page:Float w] - 原点沿法向量到平面常量 [page:.constant constant] 距离。<br /><br />
|
|
|
|
|
|
- Set the individual components that define the plane.
|
|
|
+ 设置定义平面的各个变量。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane setFromCoplanarPoints]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 a] - first point on the plane.<br />
|
|
|
- [page:Vector3 b] - second point on the plane.<br />
|
|
|
- [page:Vector3 c] - third point on the plane.<br /><br />
|
|
|
+ [page:Vector3 a] - 用于确定平面的第一个点。<br />
|
|
|
+ [page:Vector3 b] - 用于确定平面的第二个点。<br />
|
|
|
+ [page:Vector3 c] - 用于确定平面的第三个点。<br /><br />
|
|
|
|
|
|
- Defines the plane based on the 3 provided points. The winding order is assumed to be counter-clockwise,
|
|
|
- and determines the direction of the [page:.normal normal].
|
|
|
+ 根据给定的三个点确定平面。如果三个点共线将会抛出错误。通过右手螺旋规则确定(向量叉乘)法向量 [page:.normal normal]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane setFromNormalAndCoplanarPoint]( [param:Vector3 normal], [param:Vector3 point] ) [param:Vector3 this]</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 normal] - a unit length [page:Vector3] defining the normal of the plane.<br />
|
|
|
- [page:Vector3 point] - [page:Vector3]<br /><br />
|
|
|
+ [page:Vector3 normal] - 平面单位法向量<br />
|
|
|
+ [page:Vector3 point] - 平面上的点<br /><br />
|
|
|
|
|
|
- Sets the plane's properties as defined by a [page:Vector3 normal] and an arbitrary coplanar [page:Vector3 point].
|
|
|
+ 通过平面上的一点以及法线确定原点到平面的最短距离(常量)。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Plane translate]( [param:Vector3 offset] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 offset] - the amount to move the plane by.<br /><br />
|
|
|
+ [page:Vector3 offset] - 平移量<br /><br />
|
|
|
|
|
|
- Translates the plane by the distance defined by the [page:Vector3 offset] vector.
|
|
|
- Note that this only affects the plane constant and will not affect the normal vector.
|
|
|
+ 将平面平移给定向量大小,注意:这只会影响平面的常量不会影响平面的法向量。
|
|
|
</p>
|
|
|
|
|
|
<h2>Source</h2>
|