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. | |
|
|
Attempt to strike convex polygon with the ray. Returns nan if no strike occurred. |
|
||||||||||||||||
|
Attempt to strike triangle with the ray. Returns nan if no strike occurred. |
|
|
Attempt to strike plane with the ray. Returns nan if no strike occurred. |
|
|
Attempt to strike box with the ray. Returns nan if no strike occurred. |
1.3.2