ray.of

The half-line from a point along a direction.

Value helperSince 0.3.0

Usage

TypeScript
Ray.of(origin: Point3, direction: Vector3): Ray

Parameters

  • originPoint3

    Where the ray starts. Required. In model.

  • directionVector3

    The direction; its length is the unit of the ray parameter. Required. In model.

Returns

A new { origin, direction }; the direction is not normalised or checked.

Example

TypeScript
Ray.of(Point3.origin, Vector3.zAxis) // → { origin: { x: 0, y: 0, z: 0 }, direction: { x: 0, y: 0, z: 1 } }

See also