Appearance
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
An end point of the line segment.
endPoint1
The other end point of the line segment.
plane
The plane.
result?
The object onto which to store the result.
返回
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);