Ray Values

The Ray class defines the characteristics of a ray in 3D space. A ray has two Point3 components, one defining a start position and the other a direction vector for the ray.


ray <pos_point3> <dir_point3>

Returns a new ray with given position and direction vector.

<node> as ray

Takes a scene object that has a target, such as a tape measure or a target camera and returns a ray from the object to the target. Returns undefined if the object has no target.


<ray>.pos : Float

<ray>.position : Float -- pos and position are synonyms

<ray>.dir : Point3 -- unit normalized direction vector


copy <ray>

Creates a new copy of the ray value.

For example:

newRay = copy oldRay

The new value contains a copy of the input ray value, and is independent of the input ray value.