TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::Ray Class Reference

#include <Ray.h>

Public Member Functions

void set (const Point3 &origin, const Vector3 &direction)
 
const Point3origin () const
 
const Vector3direction () const
 
const Vector3invDirection () const
 
 Ray ()
 
 Ray (const Point3 &origin, const Vector3 &direction)
 
 Ray (class BinaryInput &b)
 
void serialize (class BinaryOutput &b) const
 
void deserialize (class BinaryInput &b)
 
Ray bumpedRay (float distance) const
 
Ray bumpedRay (float distance, const Vector3 &bumpDirection) const
 
Point3 closestPoint (const Point3 &point) const
 Returns the closest point on the Ray to point. More...
 
float distance (const Point3 &point) const
 
Point3 intersection (const class Plane &plane) const
 
float intersectionTime (const class Sphere &sphere, bool solid=false) const
 
float intersectionTime (const class Plane &plane) const
 
float intersectionTime (const class Box &box) const
 
float intersectionTime (const class AABox &box) const
 
float intersectionTime (const Vector3 &v0, const Vector3 &v1, const Vector3 &v2, const Vector3 &edge01, const Vector3 &edge02, float &w0, float &w1, float &w2) const
 
float intersectionTime (const Point3 &vert0, const Point3 &vert1, const Point3 &vert2, const Vector3 &edge01, const Vector3 &edge02) const
 
float intersectionTime (const Point3 &vert0, const Point3 &vert1, const Point3 &vert2) const
 
float intersectionTime (const Point3 &vert0, const Point3 &vert1, const Point3 &vert2, float &w0, float &w1, float &w2) const
 
float intersectionTime (const Triangle &triangle) const
 
float intersectionTime (const Triangle &triangle, float &w0, float &w1, float &w2) const
 
Ray refract (const Vector3 &newOrigin, const Vector3 &normal, float iInside, float iOutside) const
 
Ray reflect (const Vector3 &newOrigin, const Vector3 &normal) const
 

Static Public Member Functions

static Ray fromOriginAndDirection (const Point3 &point, const Vector3 &direction)
 

Private Types

enum  Classification {
  MMM, MMP, MPM, MPP,
  PMM, PMP, PPM, PPP,
  POO, MOO, OPO, OMO,
  OOP, OOM, OMM, OMP,
  OPM, OPP, MOM, MOP,
  POM, POP, MMO, MPO,
  PMO, PPO
}
 

Private Attributes

Point3 m_origin
 
Vector3 m_direction
 
Vector3 m_invDirection
 
Classification classification
 
float ibyj
 
float jbyi
 
float kbyj
 
float jbyk
 
float ibyk
 
float kbyi
 
float c_xy
 
float c_xz
 
float c_yx
 
float c_yz
 
float c_zx
 
float c_zy
 

Friends

class Intersect
 

Detailed Description

A 3D Ray.

Member Enumeration Documentation

The following are for the "ray slope" optimization from "Fast Ray / Axis-Aligned Bounding Box Overlap Tests using Ray Slopes" by Martin Eisemann, Thorsten Grosch, Stefan M��ller and Marcus Magnor Computer Graphics Lab, TU Braunschweig, Germany and University of Koblenz-Landau, Germany

Enumerator
MMM 
MMP 
MPM 
MPP 
PMM 
PMP 
PPM 
PPP 
POO 
MOO 
OPO 
OMO 
OOP 
OOM 
OMM 
OMP 
OPM 
OPP 
MOM 
MOP 
POM 
POP 
MMO 
MPO 
PMO 
PPO 
42 {MMM, MMP, MPM, MPP, PMM, PMP, PPM, PPP, POO, MOO, OPO, OMO, OOP, OOM, OMM, OMP, OPM, OPP, MOM, MOP, POM, POP, MMO, MPO, PMO, PPO};
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42

Constructor & Destructor Documentation

G3D::Ray::Ray ( )
inline
70  {
72  }
static const Vector3 & unitX()
Definition: Vector3.cpp:121
static const Vector3 & zero()
Definition: Vector3.cpp:119
void set(const Point3 &origin, const Vector3 &direction)
Definition: Ray.cpp:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G3D::Ray::Ray ( const Point3 origin,
const Vector3 direction 
)
inline
Parameters
directionAssumed to have unit length
75  {
77  }
void set(const Point3 &origin, const Vector3 &direction)
Definition: Ray.cpp:18
const Point3 & origin() const
Definition: Ray.h:56
const Vector3 & direction() const
Definition: Ray.h:61

+ Here is the call graph for this function:

G3D::Ray::Ray ( class BinaryInput b)
126  {
127  deserialize(b);
128 }
void deserialize(class BinaryInput &b)
Definition: Ray.cpp:137

+ Here is the call graph for this function:

Member Function Documentation

Ray G3D::Ray::bumpedRay ( float  distance) const
inline

Returns a new ray which has the same direction but an origin advanced along direction by distance

93  {
95  }
Ray()
Definition: Ray.h:70
Point3 m_origin
Definition: Ray.h:28
float distance(const Point3 &point) const
Definition: Ray.h:118
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

Ray G3D::Ray::bumpedRay ( float  distance,
const Vector3 bumpDirection 
) const
inline

Returns a new ray which has the same direction but an origin advanced by distance * bumpDirection

99  {
100  return Ray(m_origin + bumpDirection * distance, m_direction);
101  }
Ray()
Definition: Ray.h:70
Point3 m_origin
Definition: Ray.h:28
float distance(const Point3 &point) const
Definition: Ray.h:118
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

Point3 G3D::Ray::closestPoint ( const Point3 point) const
inline

Returns the closest point on the Ray to point.

106  {
107  float t = m_direction.dot(point - m_origin);
108  if (t < 0) {
109  return m_origin;
110  } else {
111  return m_origin + m_direction * t;
112  }
113  }
float __fastcall dot(const Vector3 &rkVector) const
Definition: Vector3.h:771
Point3 m_origin
Definition: Ray.h:28
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::Ray::deserialize ( class BinaryInput b)
137  {
141 }
void deserialize(class BinaryInput &b)
Definition: Vector3.cpp:190
void set(const Point3 &origin, const Vector3 &direction)
Definition: Ray.cpp:18
Point3 m_origin
Definition: Ray.h:28
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Vector3& G3D::Ray::direction ( ) const
inline

Unit direction vector.

61  {
62  return m_direction;
63  }
Vector3 m_direction
Definition: Ray.h:31

+ Here is the caller graph for this function:

float G3D::Ray::distance ( const Point3 point) const
inline

Returns the closest distance between point and the Ray

118  {
119  return (closestPoint(point) - point).magnitude();
120  }
Point3 closestPoint(const Point3 &point) const
Returns the closest point on the Ray to point.
Definition: Ray.h:106

+ Here is the call graph for this function:

static Ray G3D::Ray::fromOriginAndDirection ( const Point3 point,
const Vector3 direction 
)
inlinestatic

Creates a Ray from a origin and a (nonzero) unit direction.

87  {
88  return Ray(point, direction);
89  }
Ray()
Definition: Ray.h:70
const Vector3 & direction() const
Definition: Ray.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Vector3 G3D::Ray::intersection ( const class Plane plane) const

Returns the point where the Ray and plane intersect. If there is no intersection, returns a point at infinity.

Planes are considered one-sided, so the ray will not intersect a plane where the normal faces in the traveling direction.

164  {
165  float d;
166  Vector3 normal = plane.normal();
167  plane.getEquation(normal, d);
168  float rate = m_direction.dot(normal);
169 
170  if (rate >= 0.0f) {
171  return Vector3::inf();
172  } else {
173  float t = -(d + m_origin.dot(normal)) / rate;
174  return m_origin + m_direction * t;
175  }
176 }
float __fastcall dot(const Vector3 &rkVector) const
Definition: Vector3.h:771
Point3 m_origin
Definition: Ray.h:28
static const Vector3 & inf()
Definition: Vector3.cpp:124
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const class Sphere sphere,
bool  solid = false 
) const

Returns the distance until intersection with the sphere or the (solid) ball bounded by the sphere. Will be 0 if inside the sphere, inf if there is no intersection.

The ray direction is not normalized. If the ray direction has unit length, the distance from the origin to intersection is equal to the time. If the direction does not have unit length, the distance = time * direction.length().

See also the G3D::CollisionDetection "movingPoint" methods, which give more information about the intersection.

Parameters
solidIf true, rays inside the sphere immediately intersect (good for collision detection). If false, they hit the opposite side of the sphere (good for ray tracing).
179  {
180  Vector3 dummy;
182  m_origin, m_direction, sphere, dummy, dummy, solid);
183 }
static float collisionTimeForMovingPointFixedSphere(const Vector3 &point, const Vector3 &velocity, const class Sphere &sphere, Vector3 &outLocation, Vector3 &outNormal=ignore, bool solid=false)
Definition: CollisionDetection.cpp:977
Point3 m_origin
Definition: Ray.h:28
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float G3D::Ray::intersectionTime ( const class Plane plane) const
186  {
187  Vector3 dummy;
189  m_origin, m_direction, plane, dummy);
190 }
Point3 m_origin
Definition: Ray.h:28
static float collisionTimeForMovingPointFixedPlane(const Vector3 &point, const Vector3 &velocity, const class Plane &plane, Vector3 &outLocation, Vector3 &outNormal=ignore)
Definition: CollisionDetection.cpp:847
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const class Box box) const
193  {
194  Vector3 dummy;
196  m_origin, m_direction, box, dummy);
197 
198  if ((time == finf()) && (box.contains(m_origin))) {
199  return 0.0f;
200  } else {
201  return time;
202  }
203 }
float finf()
Definition: g3dmath.cpp:71
Point3 m_origin
Definition: Ray.h:28
static float collisionTimeForMovingPointFixedBox(const Vector3 &point, const Vector3 &velocity, const class Box &box, Vector3 &outLocation, Vector3 &outNormal=ignore)
Definition: CollisionDetection.cpp:1176
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const class AABox box) const
206  {
207  Vector3 dummy;
208  bool inside;
210  m_origin, m_direction, box, dummy, inside);
211 
212  if ((time == finf()) && inside) {
213  return 0.0f;
214  } else {
215  return time;
216  }
217 }
float finf()
Definition: g3dmath.cpp:71
static float collisionTimeForMovingPointFixedAABox(const Vector3 &point, const Vector3 &velocity, const class AABox &box, Vector3 &outLocation, bool &inside=ignoreBool, Vector3 &outNormal=ignore)
Definition: CollisionDetection.cpp:1210
Point3 m_origin
Definition: Ray.h:28
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const Vector3 v0,
const Vector3 v1,
const Vector3 v2,
const Vector3 edge01,
const Vector3 edge02,
float &  w0,
float &  w1,
float &  w2 
) const
inline

The three extra arguments are the weights of vertices 0, 1, and 2 at the intersection point; they are useful for texture mapping and interpolated normals.

314  {
315 
316  (void)vert1;
317  (void)vert2;
318 
319  // Barycenteric coords
320  float u, v;
321 
322  float tvec[3], pvec[3], qvec[3];
323 
324  // begin calculating determinant - also used to calculate U parameter
325  CROSS(pvec, m_direction, edge2);
326 
327  // if determinant is near zero, ray lies in plane of triangle
328  const float det = DOT(edge1, pvec);
329 
330  if (det < EPSILON) {
331  return finf();
332  }
333 
334  // calculate distance from vert0 to ray origin
335  SUB(tvec, m_origin, vert0);
336 
337  // calculate U parameter and test bounds
338  u = DOT(tvec, pvec);
339  if ((u < 0.0f) || (u > det)) {
340  // Hit the plane outside the triangle
341  return finf();
342  }
343 
344  // prepare to test V parameter
345  CROSS(qvec, tvec, edge1);
346 
347  // calculate V parameter and test bounds
348  v = DOT(m_direction, qvec);
349  if ((v < 0.0f) || (u + v > det)) {
350  // Hit the plane outside the triangle
351  return finf();
352  }
353 
354  float t = DOT(edge2, qvec);
355 
356  if (t >= 0) {
357  const float inv_det = 1.0f / det;
358  t *= inv_det;
359  u *= inv_det;
360  v *= inv_det;
361 
362  w0 = (1.0f - u - v);
363  w1 = u;
364  w2 = v;
365 
366  return t;
367  } else {
368  // We had to travel backwards in time to intersect
369  return finf();
370  }
371 }
float finf()
Definition: g3dmath.cpp:71
#define SUB(dest, v1, v2)
Definition: Ray.h:242
#define DOT(v1, v2)
Definition: Ray.h:240
#define CROSS(dest, v1, v2)
Definition: Ray.h:235
Point3 m_origin
Definition: Ray.h:28
#define EPSILON
Definition: Ray.h:234
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const Point3 vert0,
const Point3 vert1,
const Point3 vert2,
const Vector3 edge01,
const Vector3 edge02 
) const
inline

Ray-triangle intersection for a 1-sided triangle. Fastest version. [http://www.acm.org/jgt/papers/MollerTrumbore97/] http://www.graphics.cornell.edu/pubs/1997/MT97.html

252  {
253 
254  (void)vert1;
255  (void)vert2;
256 
257  // Barycenteric coords
258  float u, v;
259 
260  float tvec[3], pvec[3], qvec[3];
261 
262  // begin calculating determinant - also used to calculate U parameter
263  CROSS(pvec, m_direction, edge2);
264 
265  // if determinant is near zero, ray lies in plane of triangle
266  const float det = DOT(edge1, pvec);
267 
268  if (det < EPSILON) {
269  return finf();
270  }
271 
272  // calculate distance from vert0 to ray origin
273  SUB(tvec, m_origin, vert0);
274 
275  // calculate U parameter and test bounds
276  u = DOT(tvec, pvec);
277  if ((u < 0.0f) || (u > det)) {
278  // Hit the plane outside the triangle
279  return finf();
280  }
281 
282  // prepare to test V parameter
283  CROSS(qvec, tvec, edge1);
284 
285  // calculate V parameter and test bounds
286  v = DOT(m_direction, qvec);
287  if ((v < 0.0f) || (u + v > det)) {
288  // Hit the plane outside the triangle
289  return finf();
290  }
291 
292 
293  // Case where we don't need correct (u, v):
294  const float t = DOT(edge2, qvec);
295 
296  if (t >= 0.0f) {
297  // Note that det must be positive
298  return t / det;
299  } else {
300  // We had to travel backwards in time to intersect
301  return finf();
302  }
303 }
float finf()
Definition: g3dmath.cpp:71
#define SUB(dest, v1, v2)
Definition: Ray.h:242
#define DOT(v1, v2)
Definition: Ray.h:240
#define CROSS(dest, v1, v2)
Definition: Ray.h:235
Point3 m_origin
Definition: Ray.h:28
#define EPSILON
Definition: Ray.h:234
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const Point3 vert0,
const Point3 vert1,
const Point3 vert2 
) const
inline
179  {
180 
181  return intersectionTime(vert0, vert1, vert2, vert1 - vert0, vert2 - vert0);
182  }
float intersectionTime(const class Sphere &sphere, bool solid=false) const
Definition: Ray.cpp:179

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const Point3 vert0,
const Point3 vert1,
const Point3 vert2,
float &  w0,
float &  w1,
float &  w2 
) const
inline
191  {
192 
193  return intersectionTime(vert0, vert1, vert2, vert1 - vert0, vert2 - vert0, w0, w1, w2);
194  }
float intersectionTime(const class Sphere &sphere, bool solid=false) const
Definition: Ray.cpp:179

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const Triangle triangle) const
inline
199  {
200  return intersectionTime(
201  triangle.vertex(0), triangle.vertex(1), triangle.vertex(2),
202  triangle.edge01(), triangle.edge02());
203  }
Definition: adtfile.h:46
float intersectionTime(const class Sphere &sphere, bool solid=false) const
Definition: Ray.cpp:179

+ Here is the call graph for this function:

float G3D::Ray::intersectionTime ( const Triangle triangle,
float &  w0,
float &  w1,
float &  w2 
) const
inline
210  {
211  return intersectionTime(triangle.vertex(0), triangle.vertex(1), triangle.vertex(2),
212  triangle.edge01(), triangle.edge02(), w0, w1, w2);
213  }
Definition: adtfile.h:46
float intersectionTime(const class Sphere &sphere, bool solid=false) const
Definition: Ray.cpp:179

+ Here is the call graph for this function:

const Vector3& G3D::Ray::invDirection ( ) const
inline

Component-wise inverse of direction vector. May have inf() components

66  {
67  return m_invDirection;
68  }
Vector3 m_invDirection
Definition: Ray.h:34

+ Here is the caller graph for this function:

const Point3& G3D::Ray::origin ( ) const
inline
56  {
57  return m_origin;
58  }
Point3 m_origin
Definition: Ray.h:28

+ Here is the caller graph for this function:

Ray G3D::Ray::reflect ( const Vector3 newOrigin,
const Vector3 normal 
) const

Reflects about the normal using G3D::Vector3::reflectionDirection and bumps the ray slightly from the newOrigin.

157  {
158 
159  Vector3 D = m_direction.reflectionDirection(normal);
160  return Ray(newOrigin + (D + normal) * 0.001f, D);
161 }
Ray()
Definition: Ray.h:70
Vector3 reflectionDirection(const Vector3 &normal) const
Definition: Vector3.cpp:315
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

Ray G3D::Ray::refract ( const Vector3 newOrigin,
const Vector3 normal,
float  iInside,
float  iOutside 
) const

Refracts about the normal using G3D::Vector3::refractionDirection and bumps the ray slightly from the newOrigin.

148  {
149 
150  Vector3 D = m_direction.refractionDirection(normal, iInside, iOutside);
151  return Ray(newOrigin + (m_direction + normal * (float)sign(m_direction.dot(normal))) * 0.001f, D);
152 }
float __fastcall dot(const Vector3 &rkVector) const
Definition: Vector3.h:771
Vector3 refractionDirection(const Vector3 &normal, float iInside, float iOutside) const
Definition: Vector3.cpp:321
Ray()
Definition: Ray.h:70
double sign(double fValue)
Definition: g3dmath.h:669
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

void G3D::Ray::serialize ( class BinaryOutput b) const
131  {
132  m_origin.serialize(b);
134 }
void serialize(class BinaryOutput &b) const
Definition: Vector3.cpp:219
Point3 m_origin
Definition: Ray.h:28
Vector3 m_direction
Definition: Ray.h:31

+ Here is the call graph for this function:

void G3D::Ray::set ( const Point3 origin,
const Vector3 direction 
)
Parameters
directionAssumed to have unit length
18  {
19  m_origin = origin;
22 
24 
25  // ray slope
26  ibyj = m_direction.x * m_invDirection.y;
27  jbyi = m_direction.y * m_invDirection.x;
28  jbyk = m_direction.y * m_invDirection.z;
29  kbyj = m_direction.z * m_invDirection.y;
30  ibyk = m_direction.x * m_invDirection.z;
31  kbyi = m_direction.z * m_invDirection.x;
32 
33  // precomputed terms
34  c_xy = m_origin.y - jbyi * m_origin.x;
35  c_xz = m_origin.z - kbyi * m_origin.x;
36  c_yx = m_origin.x - ibyj * m_origin.y;
37  c_yz = m_origin.z - kbyj * m_origin.y;
38  c_zx = m_origin.x - ibyk * m_origin.z;
39  c_zy = m_origin.y - jbyk * m_origin.z;
40 
41  //ray slope classification
42  if (m_direction.x < 0) {
43  if (m_direction.y < 0) {
44  if (m_direction.z < 0) {
46  } else if (m_direction.z > 0) {
48  } else { //(m_direction.z >= 0)
50  }
51  } else { //(m_direction.y >= 0)
52  if (m_direction.z < 0) {
53  if (m_direction.y == 0) {
55  } else {
57  }
58  } else { //(m_direction.z >= 0)
59  if ((m_direction.y == 0) && (m_direction.z == 0)) {
61  } else if (m_direction.z == 0) {
63  } else if (m_direction.y == 0) {
65  } else {
67  }
68  }
69  }
70  } else { //(m_direction.x >= 0)
71  if (m_direction.y < 0) {
72  if (m_direction.z < 0) {
73  if (m_direction.x == 0) {
75  } else {
77  }
78  } else { //(m_direction.z >= 0)
79  if ((m_direction.x == 0) && (m_direction.z == 0)) {
81  } else if (m_direction.z == 0) {
83  } else if (m_direction.x == 0) {
85  } else {
87  }
88  }
89  } else { //(m_direction.y >= 0)
90  if (m_direction.z < 0) {
91  if ((m_direction.x == 0) && (m_direction.y == 0)) {
93  } else if (m_direction.x == 0) {
95  } else if (m_direction.y == 0) {
97  } else {
99  }
100  } else { //(m_direction.z > 0)
101  if (m_direction.x == 0) {
102  if (m_direction.y == 0) {
104  } else if (m_direction.z == 0) {
106  } else {
108  }
109  } else {
110  if ((m_direction.y == 0) && (m_direction.z == 0)) {
112  } else if (m_direction.y == 0) {
114  } else if (m_direction.z == 0) {
116  } else {
118  }
119  }
120  }
121  }
122  }
123 }
float c_zy
Definition: Ray.h:50
float c_xy
Definition: Ray.h:50
float x
Definition: Vector3.h:62
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
float c_xz
Definition: Ray.h:50
Definition: Ray.h:42
Definition: Ray.h:42
Classification classification
Definition: Ray.h:44
float ibyk
Definition: Ray.h:47
float y
Definition: Vector3.h:62
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
Definition: Ray.h:42
#define debugAssert(exp)
Definition: debugAssert.h:160
float jbyi
Definition: Ray.h:47
Definition: Ray.h:42
float c_yx
Definition: Ray.h:50
Definition: Ray.h:42
float c_yz
Definition: Ray.h:50
Definition: Ray.h:42
Vector3 m_invDirection
Definition: Ray.h:34
Definition: Ray.h:42
float c_zx
Definition: Ray.h:50
float z
Definition: Vector3.h:62
float kbyj
Definition: Ray.h:47
Point3 m_origin
Definition: Ray.h:28
const Point3 & origin() const
Definition: Ray.h:56
float jbyk
Definition: Ray.h:47
Definition: Ray.h:42
float ibyj
Definition: Ray.h:47
Definition: Ray.h:42
Definition: Ray.h:42
float kbyi
Definition: Ray.h:47
Definition: Ray.h:42
Definition: Ray.h:42
static const Vector3 & one()
Definition: Vector3.cpp:120
bool isUnit() const
Definition: Vector3.h:805
const Vector3 & direction() const
Definition: Ray.h:61
Definition: Ray.h:42
Definition: Ray.h:42
Vector3 m_direction
Definition: Ray.h:31
Definition: Ray.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class Intersect
friend

Member Data Documentation

float G3D::Ray::c_xy
private

Precomputed components

float G3D::Ray::c_xz
private
float G3D::Ray::c_yx
private
float G3D::Ray::c_yz
private
float G3D::Ray::c_zx
private
float G3D::Ray::c_zy
private
Classification G3D::Ray::classification
private
float G3D::Ray::ibyj
private

ray slope

float G3D::Ray::ibyk
private
float G3D::Ray::jbyi
private
float G3D::Ray::jbyk
private
float G3D::Ray::kbyi
private
float G3D::Ray::kbyj
private
Vector3 G3D::Ray::m_direction
private

Unit length

Vector3 G3D::Ray::m_invDirection
private

1.0 / direction

Point3 G3D::Ray::m_origin
private

The documentation for this class was generated from the following files: