表示从所提供的原点沿所提供的方向无限延伸的射线。
Name | Type | Default | Description |
---|---|---|---|
origin |
Cartesian3 |
Cartesian3.ZERO
|
optional 射线的原点。 |
direction |
Cartesian3 |
Cartesian3.ZERO
|
optional 射线的方向。 |
Members
direction : Cartesian3
射线的方向。
origin : Cartesian3
射线的原点。
-
Default Value:
Cartesian3.ZERO
Methods
staticCesium.Ray.clone(ray, result) → Ray
复制一个Ray实例。
Name | Type | Description |
---|---|---|
ray |
Ray | 要复制的射线。 |
result |
Ray | optional 存储结果的对象。 |
Returns:
修改后的结果参数或新的Ray实例(如果没有提供)。(如果ray未定义,则返回undefined)
staticCesium.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:
// 求出射线与椭球的第一个交点。
var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
var point = Cesium.Ray.getPoint(ray, intersection.start);