English中文

Ray

new Cesium.Ray(origin, direction)

表示从指定原点沿指定方向无限延伸的射线。 Represents a ray that extends infinitely from the provided origin in the provided direction.
名称 Name 类型 Type 默认值 Default 说明 Description
origin Cartesian3 Cartesian3.ZERO 可选 optional 射线的起源。 The origin of the ray.
direction Cartesian3 Cartesian3.ZERO 可选 optional 射线的方向。 The direction of the ray.

成员 Members

射线的方向。 The direction of the ray.
射线的起源。 The origin of the ray.
默认值: Default Value: Cartesian3.ZERO

方法 Methods

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

Duplicates a Ray instance.
名称 Name 类型 Type 说明 Description
ray Ray 要复制的光线。 The ray to duplicate.
result Ray 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 Ray 实例(如果未提供)。 (如果射线未定义,则返回未定义) 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

计算沿 r(t) = o + t*d 给出的射线的点,其中 o 是射线的原点,d 是方向。 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.
名称 Name 类型 Type 说明 Description
ray Ray 射线。 The ray.
t number 标量值。 A scalar value.
result Cartesian3 可选 optional 将存储结果的对象。 The object in which the result will be stored.
返回: Returns:
修改后的结果参数,如果未提供则为新实例。 The modified result parameter, or a new instance if none was provided.
示例: Example:
//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);
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.