Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
|
#include <Ray.h>
Public Member Functions | |
Ray () | |
Ray (const Vector3D &origin, const Vector3D &dir) | |
bool | Intersect (const Vector3D &pos, const float radius, float *dist) const |
bool | Intersect (const Vector3D &p1, const Vector3D &p2, const Vector3D &p3, const bool cull, float *dist) const |
bool | Intersect (const Vector3D &bbMin, const Vector3D &bbMax, Vector3D *intersectPoint) const |
Public Attributes | |
Vector3D | mOrigin |
Vector3D | mDirection |
3d ray with position and direction.
Ult::Ray::Ray | ( | ) |
Ray constructor.
Ray constructor with input origin and direction.
bool Ult::Ray::Intersect | ( | const Vector3D & | bbMin, |
const Vector3D & | bbMax, | ||
Vector3D * | intersectPoint ) const |
Returns true if the input bounding box (bbMin,bbMax) intersects with this ray and optionally stores the intersection point if given.
bool Ult::Ray::Intersect | ( | const Vector3D & | p1, |
const Vector3D & | p2, | ||
const Vector3D & | p3, | ||
const bool | cull, | ||
float * | dist ) const |
Returns true if the input triangle (p1,p2,p3) intersects with this ray and stores the distance in 'dist' if given. Can optionally ignore intersection/return false if 'cull' is true and the triangle is back-facing.
bool Ult::Ray::Intersect | ( | const Vector3D & | pos, |
const float | radius, | ||
float * | dist ) const |
Returns true if the input sphere (pos and radius) intersects with this ray and stores the distance in 'dist' if given.
Vector3D Ult::Ray::mDirection |
The ray's forward direction.
Vector3D Ult::Ray::mOrigin |
The ray's starting position.