Ray

class cee.Ray()

A 3d ray used, for example, for picking on the 3D model.

Constructors

Accessors


Constructors

Ray.constructor(origin, direction)
Arguments:

Creates a Ray object

Return type:Ray

Accessors

Ray.direction()

The direction vector of the ray in world coordinates.

Return type:Vec3Like
Ray.direction(direction)
Arguments:
Return type:

void

Ray.origin()

The origin of the ray in world coordinates.

Return type:Vec3Like
Ray.origin(origin)
Arguments:
Return type:

void

Methods

clone

Ray.clone()

Returns a clone of the ray.

Return type:Ray

planeIntersect

Ray.planeIntersect(plane)
Arguments:

Returns the intersection point of this ray with the given plane, or null if no intersection.

Return type:Vec3Like

pointDistanceSquared

Ray.pointDistanceSquared(point)
Arguments:

Returns the squared distance from the point to the ray

Return type:number

transform

Ray.transform(matrix)
Arguments:
  • matrix (Mat4) – None

Transforms the ray with the given matrix.

The origin will be transformed as a point, and the direction as a vector.

Return type:void