Methods
static Cesium.IntersectionTests.grazingAltitudeLocation(ray, ellipsoid) → Cartesian3
返回射线上距离椭球体最近的点。
| Name | Type | Description |
|---|---|---|
ray |
Ray | 射线。 |
ellipsoid |
Ellipsoid | 椭球体。 |
Returns:
射线上最近的测地坐标点。
static Cesium.IntersectionTests.lineSegmentPlane(endPoint0, endPoint1, plane, result) → Cartesian3
计算线段与平面的交点。
| Name | Type | Description |
|---|---|---|
endPoint0 |
Cartesian3 | 线段的一个端点。 |
endPoint1 |
Cartesian3 | 线段的另一个端点。 |
plane |
Plane | 平面。 |
result |
Cartesian3 | optional 存储结果的对象。 |
Returns:
交点,若无交点则返回 undefined。
static Cesium.IntersectionTests.lineSegmentSphere(p0, p1, sphere, result) → Interval
计算线段与球体的交点。
| Name | Type | Description |
|---|---|---|
p0 |
Cartesian3 | 线段的一个端点。 |
p1 |
Cartesian3 | 线段的另一个端点。 |
sphere |
BoundingSphere | 球体。 |
result |
Interval | optional 存储结果的对象。 |
Returns:
包含沿射线标量点的区间,若无交点则返回 undefined。
static Cesium.IntersectionTests.lineSegmentTriangle(v0, v1, p0, p1, p2, cullBackFaces, result) → Cartesian3
计算线段与三角形的交点。
| Name | Type | Default | Description |
|---|---|---|---|
v0 |
Cartesian3 | 线段的一个端点。 | |
v1 |
Cartesian3 | 线段的另一个端点。 | |
p0 |
Cartesian3 | 三角形的第一个顶点。 | |
p1 |
Cartesian3 | 三角形的第二个顶点。 | |
p2 |
Cartesian3 | 三角形的第三个顶点。 | |
cullBackFaces |
boolean |
false
|
optional
如果为 true,则仅计算与三角形正面的交点,
与背面的交点将返回 undefined。 |
result |
Cartesian3 |
optional
存储结果的 Cartesian3 对象。 |
Returns:
交点,若无交点则返回 undefined。
计算射线与轴对齐包围盒的交点(与射线同空间的轴对齐)。
| Name | Type | Description |
|---|---|---|
ray |
Ray | 射线。 |
box |
AxisAlignedBoundingBox | 轴对齐包围盒。 |
result |
Interval | undefined | 包含沿射线标量点的区间,若无交点则返回 undefined。 |
static Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid) → Interval
计算射线与椭球体的交点。
| Name | Type | Description |
|---|---|---|
ray |
Ray | 射线。 |
ellipsoid |
Ellipsoid | 椭球体。 |
Returns:
包含沿射线标量点的区间,若无交点则返回 undefined。
static Cesium.IntersectionTests.rayPlane(ray, plane, result) → Cartesian3
计算射线与平面的交点。
| Name | Type | Description |
|---|---|---|
ray |
Ray | 射线。 |
plane |
Plane | 平面。 |
result |
Cartesian3 | optional 存储结果的对象。 |
Returns:
交点,若无交点则返回 undefined。
static Cesium.IntersectionTests.raySphere(ray, sphere, result) → Interval
计算射线与球体的交点。
| Name | Type | Description |
|---|---|---|
ray |
Ray | 射线。 |
sphere |
BoundingSphere | 球体。 |
result |
Interval | optional 存储结果的对象。 |
Returns:
包含沿射线标量点的区间,若无交点则返回 undefined。
static Cesium.IntersectionTests.rayTriangle(ray, p0, p1, p2, cullBackFaces, result) → Cartesian3
计算射线与三角形的交点,以笛卡尔坐标表示。
实现自 Tomas Moller 和 Ben Trumbore 的 {@link https://cadxfem.org/inf/Fast MinimumStorage RayTriangle Intersection.pdf|
Fast Minimum Storage Ray/Triangle Intersection}。
| Name | Type | Default | Description |
|---|---|---|---|
ray |
Ray | 射线。 | |
p0 |
Cartesian3 | 三角形的第一个顶点。 | |
p1 |
Cartesian3 | 三角形的第二个顶点。 | |
p2 |
Cartesian3 | 三角形的第三个顶点。 | |
cullBackFaces |
boolean |
false
|
optional
如果为 true,则仅计算与三角形正面的交点,
与背面的交点将返回 undefined。 |
result |
Cartesian3 |
optional
存储结果的 Cartesian3 对象。 |
Returns:
交点,若无交点则返回 undefined。
计算射线与三角形的交点,以沿输入射线的参数距离表示。当三角形在射线后方时结果为负。
实现自 Tomas Moller 和 Ben Trumbore 的 {@link https://cadxfem.org/inf/Fast MinimumStorage RayTriangle Intersection.pdf|
Fast Minimum Storage Ray/Triangle Intersection}。
| Name | Type | Default | Description |
|---|---|---|---|
ray |
Ray | 射线。 | |
p0 |
Cartesian3 | 三角形的第一个顶点。 | |
p1 |
Cartesian3 | 三角形的第二个顶点。 | |
p2 |
Cartesian3 | 三角形的第三个顶点。 | |
cullBackFaces |
boolean |
false
|
optional
如果为 true,则仅计算与三角形正面的交点,
与背面的交点将返回 undefined。 |
Returns:
沿射线的参数距离交点,若无交点则返回 undefined。
计算三角形与平面的交点。
| Name | Type | Description |
|---|---|---|
p0 |
Cartesian3 | 三角形的第一个点。 |
p1 |
Cartesian3 | 三角形的第二个点。 |
p2 |
Cartesian3 | 三角形的第三个点。 |
plane |
Plane | 相交平面。 |
Returns:
包含
positions 和 indices 属性的对象,这两个数组表示不跨越平面的三个三角形(若无交点则返回 undefined)。
