Class: Ray

Ray

new Ray(origin, direction)

Represents a ray that extends infinitely from a given origin in a given direction.

Name Type Default Description
origin Cartesian3 Cartesian3.ZERO optional

The origin of the ray.

direction Cartesian3 Cartesian3.ZERO optional

The direction of the radiation.

Members

directionCartesian3

The direction of the radiation.

originCartesian3

The origin of the ray.

Default Value:
Cartesian3.ZERO

Methods

static clone(ray, result){Ray}

Assign a ray instance.

Name Type Description
ray Ray

The ray to be copied.

result Ray optional

The object for storing results is undefined if a new instance needs to be created.

Returns:
Type Description
Ray If not provided, the modified result parameters or a new Ray instance will be used. (If the rectangle is undefined, return undefined)

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

Calculate the points along the ray given by r (t)=0+t * d, where 0 is the origin of the ray and d is the direction.

Name Type Description
ray Ray

Ray.

t Number

Scalar value.

result Cartesian3 optional

The object that stores the results.

Returns:
Type Description
Cartesian3 The modified result parameters, or a new instance (if not provided).
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}

Perform matrix transformation on rays

Name Type Description
ray Ray

ray

matrix Matrix4

Matrix

result Ray

Save modified rays

Returns:
Type Description
Ray Return the modified ray