API Docs for: 0.6.0
Show:

Ray Class

A line in 3D space that intersects bodies and return points.

Constructor

Ray

(
  • from
  • to
)

Parameters:

Methods

intersectBodies

(
  • bodies
)
Array

Parameters:

  • bodies Array

    An array of Body objects.

Returns:

Array:

See intersectBody

intersectBody

(
  • body
)
Array

Shoot a ray at a body, get back information about the hit.

Parameters:

Returns:

Array:

An array of results. The result objects has properties: distance (float), point (Vec3) and body (Body).

intersectShape

(
  • shape
  • quat
  • position
  • body
)
Array

Parameters:

Returns:

Array:

See intersectBody()

Properties

from

Vec3

precision

Number

The precision of the ray. Used when checking parallelity etc.