Ray

Lore. Ray

A class representing a ray

Constructor

new Ray(source, direction)

Source:

Creates an instance of Ray.

Parameters:
Name Type Description
source Vector3f

The source of the ray.

direction Vector3f

The direction of the ray.

Methods

applyProjection(m) → {Ray}

Source:

Apply a projection matrix to this ray.

Parameters:
Name Type Description
m Matrix4f | ProjectionMatrix

A matrix / projection matrix.

Returns:

Returns itself.

Type
Ray

closestPointToPoint(v) → {Vector3f}

Source:

Find a point on the ray that is closest to a supplied vector.

Parameters:
Name Type Description
v Vector3f

A vector.

Returns:

The cloest point on the ray to the supplied point.

Type
Vector3f

copyFrom(r) → {Ray}

Source:

Copy the values from another ray.

Parameters:
Name Type Description
r Ray

A ray.

Returns:

Returns itself.

Type
Ray

distanceSqToPoint(v) → {Number}

Source:

The square of the distance of a vector to this ray.

Parameters:
Name Type Description
v Vector3f

A vector.

Returns:

The square pf the distance between the point and this ray.

Type
Number