Class: Ray

Ray

new Ray(origin, direction)

表示一条从给定原点向给定方向无限延伸的射线。

Name Type Default Description
origin Cartesian3 Cartesian3.ZERO 可选

射线的原点。

direction Cartesian3 Cartesian3.ZERO 可选

射线的方向。

Members

directionCartesian3

射线的方向。

originCartesian3

射线的原点。

Default Value:
Cartesian3.ZERO

Methods

static clone(ray, result){Ray}

赋值一份射线实例。

Name Type Description
ray Ray

要复制的射线。

result Ray 可选

存储结果的对象,如果需要创建新实例,则未定义。

Returns:
Type Description
Ray 如果没有提供,则为修改后的结果参数或一个新的Ray实例。(如果矩形未定义则返回未定义)

static getPoint(ray, t, result){Cartesian3}

计算沿r(t) = 0 + t*d给出的射线的点,其中0是射线的原点,d是方向。

Name Type Description
ray Ray

射线。

t Number

标量值。

result Cartesian3 可选

存储结果的对象。

Returns:
Type Description
Cartesian3 修改后的结果参数,或一个新实例(如果没有提供)。
Example
//Get the first intersection point of a ray and an ellipsoid.
var intersection = SuperMap3D.IntersectionTests.rayEllipsoid(ray, ellipsoid);
var point = SuperMap3D.Ray.getPoint(ray, intersection.start);

static transform(ray, matrix, result){Ray}

对射线进行矩阵变换

Name Type Description
ray Ray

射线

matrix Matrix4

矩阵

result Ray

保存修改后的射线

Returns:
Type Description
Ray 返回修改后的射线