Ray

new Cesium.Ray(origin, direction)

表示从提供的原点沿给定方向无限延伸的射线。
Name Type Default Description
origin Cartesian3 Cartesian3.ZERO optional 射线的原点。
direction Cartesian3 Cartesian3.ZERO optional 光线的方向。

Members

光线的方向。
射线的原点。
Default Value: Cartesian3.ZERO

Methods

static Cesium.Ray.clone(ray, result)Ray

复制Ray实例。
Name Type Description
ray Ray 要复制的光线。
result Ray optional 要在其上存储结果的对象。
Returns:
修改后的结果参数或者新的 Ray 实例(如果未提供)。(如果 ray 未定义,则返回 undefined)

static Cesium.Ray.getPoint(ray, t, result)Cartesian3

计算沿射线的点,由 r(t) = o + t*d, 其中 o 是射线的原点,d 是方向。
Name Type Description
ray Ray 射线。
t number 一个标量值。
result Cartesian3 optional 将存储结果的对象。
Returns:
修改后的结果参数,或者如果未提供任何实例,则为新实例。
Example:
//获取射线和椭球体的第一个交点。
const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
const point = Cesium.Ray.getPoint(ray, intersection.start);
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.