Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

ray3 Struct Reference

List of all members.

Detailed Description

A three-dimensional ray (origin plus direction).


Public Member Functions

void set (vec3 origin, vec3 dir)
 Assign parameters; dir will be normalized.

void set (vec3 origin, vec3 dir, float maximum)
 Assign parameters; dir will be normalized.

void setSegment (vec3 a, vec3 b)
 Assign parameters from a line segment.

bit within (float distance)
 Return whether a distance is within the range.

vec3 strike (box3 box)
 Attempt to strike box with the ray.

vec3 strike (plane3 plane)
 Attempt to strike plane with the ray.

float strikeDistance (plane3 plane)
 Attempt to strike plane with the ray and return the distance or nan if no strike occurred.

vec3 strike (vec3 a, vec3 b, vec3 c)
 Attempt to strike triangle with the ray.

vec3 strike (vec3[] points)
 Attempt to strike convex polygon with the ray.


Public Attributes

vec3 origin
 Start of the ray.

vec3 dir
 Unit vector pointing in the direction of the ray.

float maximum
 Maximum distance for valid strikes or nan for none.

float maximumSquared
 maximum * maximum or nan for none


Related Functions

(Note that these are not member functions.)

ray3 aray3 (vec3 origin, vec3 dir)
 Create a three-dimensional ray; dir will be normalized.

ray3 aray3 (vec3 origin, vec3 dir, float maximum)
 Create a three-dimensional ray; dir will be normalized.

ray3 aray3segment (vec3 a, vec3 b)
 Create a three-dimensional array from a line segment.


Member Function Documentation

vec3 ray3.strike vec3points  []  ) 
 

Attempt to strike convex polygon with the ray.

Returns nan if no strike occurred.

vec3 ray3.strike vec3  a,
vec3  b,
vec3  c
 

Attempt to strike triangle with the ray.

Returns nan if no strike occurred.

vec3 ray3.strike plane3  plane  ) 
 

Attempt to strike plane with the ray.

Returns nan if no strike occurred.

vec3 ray3.strike box3  box  ) 
 

Attempt to strike box with the ray.

Returns nan if no strike occurred.


The documentation for this struct was generated from the following file:
Generated on Thu Sep 4 13:12:53 2003 for dig by doxygen 1.3.2