Skip to content

KBE3D / KBCore / Cesium / IntersectionTests / lineSegmentPlane

函数: lineSegmentPlane()

lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3

Computes the intersection of a line segment and a plane.

参数

endPoint0

Cartesian3

An end point of the line segment.

endPoint1

Cartesian3

The other end point of the line segment.

plane

Plane

The plane.

result?

Cartesian3

The object onto which to store the result.

返回

Cartesian3

The intersection point or undefined if there is no intersection.

示例

ts
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);

KBE3D @3.0.0 Copyright © 2024-present KBE3D