new Cesium.Ray(origin, direction)

Represents a ray that extends infinitely from the provided origin in the provided direction.
参数名称 类型 默认值 描述信息
origin Cartesian3 Cartesian3.ZERO 可选 The origin of the ray.
direction Cartesian3 Cartesian3.ZERO 可选 The direction of the ray.


The direction of the ray.
The origin of the ray.
默认值: Cartesian3.ZERO


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

Duplicates a Ray instance.
参数名称 类型 描述信息
ray Ray The ray to duplicate.
result Ray 可选 The object onto which to store the result.
The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)

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

Computes the point along the ray given by r(t) = o + t*d, where o is the origin of the ray and d is the direction.
参数名称 类型 描述信息
ray Ray The ray.
t number A scalar value.
result Cartesian3 可选 The object in which the result will be stored.
The modified result parameter, or a new instance if none was provided.
//Get the first intersection point of a ray and an ellipsoid.
const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
const point = Cesium.Ray.getPoint(ray, intersection.start);