Ray

class cee.Ray()

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

Constructors

cee.Ray.constructor()
Ray(origin: Vec3Like, direction: Vec3Like): Ray

Creates a Ray object

Parameters

origin: Vec3Like

direction: Vec3Like

Returns: Ray

Accessors

cee.Ray.direction()
get direction(): Vec3Like

The direction vector of the ray in world coordinates.

Returns: Vec3Like

set direction(direction: Vec3Like): void

Parameters

direction: Vec3Like

Returns: void

cee.Ray.origin()
get origin(): Vec3Like

The origin of the ray in world coordinates.

Returns: Vec3Like

set origin(origin: Vec3Like): void

Parameters

origin: Vec3Like

Returns: void

Methods

cee.Ray.clone()
clone(): Ray

Returns a clone of the ray.

Returns: Ray

cee.Ray.planeIntersect()
planeIntersect(plane: Plane): Vec3Like

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

Parameters

plane: Plane

Returns: Vec3Like

cee.Ray.pointDistanceSquared()
pointDistanceSquared(point: Vec3Like): number

Returns the squared distance from the point to the ray

Parameters

point: Vec3Like

Returns: number

cee.Ray.transform()
transform(matrix: Mat4): void

Transforms the ray with the given matrix.

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

Parameters

matrix: Mat4

Returns: void