计算射线,平面,三角形,椭圆等几何美图之间的交汇点的函数.

Methods

static Cesium.IntersectionTests.grazingAltitudeLocation(ray, ellipsoid)Cartesian3

提供离椭圆最近的射线沿线点.
Name Type Description
ray Ray The ray.
ellipsoid Ellipsoid The ellipsoid.
Returns:
离射线最近的行星点.

static Cesium.IntersectionTests.lineSegmentPlane(endPoint0, endPoint1, plane, result)Cartesian3

计算线段和平面的交叉点.
Name Type Description
endPoint0 Cartesian3 线路段的终点.
endPoint1 Cartesian3 线路段的另一端.
plane Plane The plane.
result Cartesian3 optional 存储结果的对象 .
Returns:
如果没有交叉点,则交叉点或未定义.
Example:
const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
const normal = ellipsoid.geodeticSurfaceNormal(origin);
const plane = Cesium.Plane.fromPointNormal(origin, normal);

const p0 = new Cesium.Cartesian3(...);
const p1 = new Cesium.Cartesian3(...);

// find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);

static Cesium.IntersectionTests.lineSegmentSphere(p0, p1, sphere, result)Interval

计算线段与球的交叉点.
Name Type Description
p0 Cartesian3 线路段的终点.
p1 Cartesian3 线路段的另一端.
sphere BoundingSphere The sphere.
result Interval optional 用于存储结果的结果 .
Returns:
包含沿射线的scalar点的间隔,如果没有交叉点则未定义.

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 If true, will only compute an intersection with the front face of the triangle 然后返回未定义的与后脸的交叉点.
result Cartesian3 optional 将结果存储在 NT 1 NT 0 NT 2 上.
Returns:
如果没有交叉点,则交叉点或未定义.

static Cesium.IntersectionTests.rayAxisAlignedBoundingBox(ray, box, result)

Computes the intersection points of a ray with an axis-aligned bounding box. (axis-aligned in the same space as the ray)
Name Type Description
ray Ray The ray.
box AxisAlignedBoundingBox 轴对齐的边框 .
result Interval | undefined 包含沿射线的scalar点的间隔,如果没有交叉点则未定义.

static Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid)Interval

用椭圆计算射线的交叉点.
Name Type Description
ray Ray The ray.
ellipsoid Ellipsoid The ellipsoid.
Returns:
包含沿射线的scalar点的间隔,如果没有交叉点则未定义.

static Cesium.IntersectionTests.rayPlane(ray, plane, result)Cartesian3

计算射线和飞机的交叉点.
Name Type Description
ray Ray The ray.
plane Plane The plane.
result Cartesian3 optional 存储结果的对象 .
Returns:
如果没有交叉点,则交叉点或未定义.

static Cesium.IntersectionTests.raySphere(ray, sphere, result)Interval

计算射线与球的交叉点.
Name Type Description
ray Ray The ray.
sphere BoundingSphere The sphere.
result Interval optional 用于存储结果的结果 .
Returns:
包含沿射线的scalar点的间隔,如果没有交叉点则未定义.

static Cesium.IntersectionTests.rayTriangle(ray, p0, p1, p2, cullBackFaces, result)Cartesian3

计算射线与三角形的交汇点为 Cartesian3 坐标. Implements 快速最小存储 Ray/Triangle Interscript由托马斯·莫勒和本·特伦博尔主演.
Name Type Default Description
ray Ray The ray.
p0 Cartesian3 三角形的第一个顶点.
p1 Cartesian3 三角形的第二个顶点.
p2 Cartesian3 三角形第三个顶点.
cullBackFaces boolean false optional If true, will only compute an intersection with the front face of the triangle 然后返回未定义的与后脸的交叉点.
result Cartesian3 optional 将结果存储在 NT 1 NT 0 NT 2 上.
Returns:
如果没有交叉点,则交叉点或未定义.

static Cesium.IntersectionTests.rayTriangleParametric(ray, p0, p1, p2, cullBackFaces)number

计算射线和三角形的交汇点,作为输入射线的参数距离. 当三角形位于射线后方时,结果为负. Implements 快速最小存储 Ray/Triangle Interscript由托马斯·莫勒和本·特伦博尔主演.
Name Type Default Description
ray Ray The ray.
p0 Cartesian3 三角形的第一个顶点.
p1 Cartesian3 三角形的第二个顶点.
p2 Cartesian3 三角形第三个顶点.
cullBackFaces boolean false optional If true, will only compute an intersection with the front face of the triangle 然后返回未定义的与后脸的交叉点.
Returns:
交汇点作为沿着射线的参数距离,或者在没有交汇点的情况下未定义.

static Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane)object

计算三角形和平面的交汇点
Name Type Description
p0 Cartesian3 三角形的第一个点
p1 Cartesian3 三角形第二点
p2 Cartesian3 三角形第三点
plane Plane Intersection plane
Returns:
An object with properties positions and indices, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)
Example:
const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
const normal = ellipsoid.geodeticSurfaceNormal(origin);
const plane = Cesium.Plane.fromPointNormal(origin, normal);

const p0 = new Cesium.Cartesian3(...);
const p1 = new Cesium.Cartesian3(...);
const p2 = new Cesium.Cartesian3(...);

// convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.