表示从提供的原点沿提供的方向无限延伸的光线。
| Name | Type | Default | Description |
|---|---|---|---|
origin |
Cartesian3 |
Cartesian3.ZERO
|
optional 光线的原点。 |
direction |
Cartesian3 |
Cartesian3.ZERO
|
optional 光线的方向。 |
Members
direction : Cartesian3
光线的方向。
origin : Cartesian3
光线的原点。
-
Default Value:
Cartesian3.ZERO
Methods
static Cesium.Ray.clone(ray, result) → Ray
复制一个光线实例。
| Name | Type | Description |
|---|---|---|
ray |
Ray | 要复制的光线。 |
result |
Ray | optional 存储结果的对象。 |
Returns:
修改后的结果参数或如果未提供结果参数则返回的新 Ray 实例。(如果 ray 为 undefined,则返回 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:
//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);
