一个采用 Hessian 法线形式定义的平面,其方程为
ax + by + cz + d = 0其中 (a, b, c) 为平面的
normal(法向),d 为到平面的带符号
distance(距离),而 (x, y, z) 为平面上的任意一点。
| Name | Type | Description |
|---|---|---|
normal |
Cartesian3 | 平面的法向(已归一化)。 |
distance |
number |
从原点到平面的最短距离。 distance 的符号决定原点位于平面的哪一侧。
如果 distance 为正,则原点位于法向所指的半空间;如果为负,则原点位于与法向相反的半空间;
如果为零,则平面经过原点。 |
Throws:
-
DeveloperError : 法向必须已归一化
Example:
// The plane x=0
const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
Members
static constant Cesium.Plane.ORIGIN_XY_PLANE : Plane
一个初始化为经过原点、法向指向正 Z 方向的 XY 平面的常量。
static constant Cesium.Plane.ORIGIN_YZ_PLANE : Plane
一个初始化为经过原点、法向指向正 X 方向的 YZ 平面的常量。
static constant Cesium.Plane.ORIGIN_ZX_PLANE : Plane
一个初始化为经过原点、法向指向正 Y 方向的 ZX 平面的常量。
从原点到平面的最短距离。
distance 的符号决定原点位于平面的哪一侧。
如果 distance 为正,则原点位于法向所指的半空间;如果为负,则原点位于与法向相反的半空间;
如果为零,则平面经过原点。
normal : Cartesian3
平面的法向。
Methods
static Cesium.Plane.clone(plane, result) → Plane
复制一个 Plane 实例。
| Name | Type | Description |
|---|---|---|
plane |
Plane | 要复制的平面。 |
result |
Plane | optional 用于存储结果的对象。 |
Returns:
被修改的 result 参数;如果未提供,则为一个新的 Plane 实例。
按法向和距离比较两个给定的 Plane,若相等则返回
true,否则返回 false。
| Name | Type | Description |
|---|---|---|
left |
Plane | 第一个平面。 |
right |
Plane | 第二个平面。 |
Returns:
如果 left 与 right 相等则返回
true,否则返回 false。
static Cesium.Plane.fromCartesian4(coefficients, result) → Plane
根据一般方程创建一个平面
| Name | Type | Description |
|---|---|---|
coefficients |
Cartesian4 | 平面的法向(已归一化)。 |
result |
Plane | optional 用于存储结果的对象。 |
Returns:
一个新的平面实例,或被修改的 result 参数。
Throws:
-
DeveloperError : 法向必须已归一化
static Cesium.Plane.fromPointNormal(point, normal, result) → Plane
根据法向和平面上的一个点创建一个平面。
| Name | Type | Description |
|---|---|---|
point |
Cartesian3 | 平面上的点。 |
normal |
Cartesian3 | 平面的法向(已归一化)。 |
result |
Plane | optional 用于存储结果的对象。 |
Returns:
一个新的平面实例,或被修改的 result 参数。
Throws:
-
DeveloperError : 法向必须已归一化
Example:
const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
const normal = ellipsoid.geodeticSurfaceNormal(point);
const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
计算一个点到一个平面的带符号最短距离。
距离的符号决定该点位于平面的哪一侧。如果距离为正,则点位于法向所指的半空间;如果为负,则点位于与法向相反的半空间;如果为零,则平面经过该点。
| Name | Type | Description |
|---|---|---|
plane |
Plane | 平面。 |
point |
Cartesian3 | 点。 |
Returns:
该点到平面的带符号最短距离。
static Cesium.Plane.projectPointOntoPlane(plane, point, result) → Cartesian3
将一个点投影到平面上。
| Name | Type | Description |
|---|---|---|
plane |
Plane | 要将点投影到的平面 |
point |
Cartesian3 | 要投影到平面上的点 |
result |
Cartesian3 | optional 结果点。如果未定义,将创建一个新的 Cartesian3。 |
Returns:
被修改的 result 参数;如果未提供,则为一个新的 Cartesian3 实例。
static Cesium.Plane.transform(plane, transform, result) → Plane
使用给定的变换矩阵对平面进行变换。
| Name | Type | Description |
|---|---|---|
plane |
Plane | 平面。 |
transform |
Matrix4 | 变换矩阵。 |
result |
Plane | optional 用于存储结果的对象。 |
Returns:
经给定变换矩阵变换后的平面。
