Plane

new Cesium.Plane(normal, distance)

Hessian范式的平面,由
ax + by + cz + d = 0
定义, 其中(a, b, c)是平面的normal, d 是到平面的有符号distance,(x, y, z)是平面上的任意点。
Name Type Description
normal Cartesian3 平面的法线(归一化)。
distance Number 从原点到平面的最短距离。 distance>的符号决定了原点在平面的哪一边。 如果距离为正,则该点在方向为法线的半空间(half-space)内; 如果为负,则该点在与法线相对的半空间(half-space)内; 如果为零,平面通过该点。
Throws:
Example:
// The plane x=0
var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);

Members

staticconstantCesium.Plane.ORIGIN_XY_PLANE : Plane

常数,初始化为通过原点的XY平面,法向量在正Z方向。

staticconstantCesium.Plane.ORIGIN_YZ_PLANE : Plane

常数,初始化为通过原点的YZ平面,法向量在正X方向。

staticconstantCesium.Plane.ORIGIN_ZX_PLANE : Plane

常数,初始化为通过原点的ZX平面,法向量在正Y方向。

distance : Number

从原点到平面的最短距离。 distance>的符号决定了原点在平面的哪一边。 如果距离为正,则该点在方向为法线的半空间(half-space)内; 如果为负,则该点在与法线相对的半空间(half-space)内; 如果为零,平面通过该点。
平面的法线。

Methods

staticCesium.Plane.clone(plane, result)Plane

Duplicates a Plane instance.
Name Type Description
plane Plane The plane to duplicate.
result Plane optional The object onto which to store the result.
Returns:
The modified result parameter or a new Plane instance if one was not provided.

staticCesium.Plane.equals(left, right)Boolean

将提供的平面按法线和距离进行比较,如果相等则返回true,否则返回false
Name Type Description
left Plane 第一个平面。
right Plane 第二个平面。
Returns:
如果两者相等,则为true;否则false

staticCesium.Plane.fromCartesian4(coefficients, result)Plane

从通用方程创建一个平面。
Name Type Description
coefficients Cartesian4 平面的法线(归一化)。
result Plane optional 存储结果的对象。
Returns:
一个新的平面实例或修改后的结果参数。
Throws:

staticCesium.Plane.fromPointNormal(point, normal, result)Plane

从平面上的法线和点创建一个平面。
Name Type Description
point Cartesian3 平面上的点。
normal Cartesian3 平面的法线(归一化)。
result Plane optional 存储结果的对象。
Returns:
一个新的平面实例或修改后的结果参数。
Throws:
Example:
var point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
var normal = ellipsoid.geodeticSurfaceNormal(point);
var tangentPlane = Cesium.Plane.fromPointNormal(point, normal);

staticCesium.Plane.getPointDistance(plane, point)Number

计算点到平面的有符号的(signed)最短距离。 距离的符号决定了这个点在平面的哪一边。 如果距离为正,则该点在方向为法线的半空间(half-space)内; 如果为负,则该点在与法线相对的半空间(half-space)内; 如果为零,平面通过该点。
Name Type Description
plane Plane 平面。
point Cartesian3 点。
Returns:
点到平面的有符号最短距离。

staticCesium.Plane.projectPointOntoPlane(plane, point, result)Cartesian3

将一个点投影到平面上。
Name Type Description
plane Plane 投影点的平面
point Cartesian3 投影到平面上的点
result Cartesian3 optional 结果点。如果未定义,将创建一个新的Cartesian3。
Returns:
修改后的结果参数,如果没有提供则创建一个新的Cartesian3实例。

staticCesium.Plane.transform(plane, transform, result)Plane

用给定的变换矩阵变换平面。
Name Type Description
plane Plane 要变换的平面。
transform Matrix4 变换矩阵。
result Plane optional 存储结果的对象。
Returns:
被给定的变换矩阵变换后的平面。