Provide functions for the creation and manipulation of Rays.

A ray begins as a single point and extends infinitely in a direction.

The first vector is the origin of the ray. The second vector is the direction of the ray relative to the origin.

The following functions will normalize the ray direction to unit length. Some functions may work correctly with directions that are not unit length, but this may vary from function to function.

pyrr.ray.create(*args, **kwargs)[source]
pyrr.ray.create_from_line(*args, **kwargs)[source]

Converts a line or line segment to a ray.

pyrr.ray.direction(*args, **kwargs)[source]
class pyrr.ray.index[source]
direction = 1

The index of the direction vector within the ray

position = 0

The index of the start vector within the ray

pyrr.ray.invert(*args, **kwargs)[source]
pyrr.ray.position(*args, **kwargs)[source]