point3.h File Reference

point3.h File Reference
+ This reference page is linked to from the following overview topics:

#include "GeomExport.h"
#include "maxheap.h"
#include "gfloat.h"
#include "assert1.h"
#include <math.h>

Classes

class  Point3
 
class  Ray
 

Typedefs

typedef Point3 UVVert
 
typedef Point3 VertColor
 

Functions

float Length (const Point3 &)
 
float FLength (const Point3 &)
 
float LengthSquared (const Point3 &)
 
int MaxComponent (const Point3 &)
 
int MinComponent (const Point3 &)
 
Point3 Normalize (const Point3 &)
 
Point3 FNormalize (const Point3 &)
 
Point3 CrossProd (const Point3 &a, const Point3 &b)
 
__forceinline Point3 operator* (float f, const Point3 &a)
 
__forceinline Point3 operator* (const Point3 &a, float f)
 
__forceinline Point3 operator/ (const Point3 &a, float f)
 
__forceinline Point3 operator+ (const Point3 &a, float f)
 
__forceinline float DotProd (const Point3 &a, const Point3 &b)
 

Typedef Documentation

typedef Point3 UVVert
typedef Point3 VertColor

Function Documentation

float Length ( const Point3 v)
inline
Remarks
Returns the 'Length' of the point (vector). This is:

sqrt(v.x*v.x+v.y*v.y+v.z*v.z)
241  {
242  return v.Length();
243  }
float Length() const
Definition: point3.h:229
float FLength ( const Point3 v)
inline
Remarks
Returns the 'Length' of the point (vector) using a faster assembly language implementation for square root. This is:

Sqrt(v.x*v.x+v.y*v.y+v.z*v.z)
245  {
246  return v.FLength();
247  }
float FLength() const
Definition: point3.h:233
__forceinline float LengthSquared ( const Point3 v)
Remarks
The 'Length' squared of the point. This is v.x*v.x+v.y*v.y+v.z*v.z.
249  {
250  return v.LengthSquared();
251  }
float LengthSquared() const
Definition: point3.h:237
int MaxComponent ( const Point3 )
Remarks
Returns the component with the maximum absolute value. 0=x, 1=y, 2=z.
int MinComponent ( const Point3 )
Remarks
Returns the component with the minimum absolute value. 0=x, 1=y, 2=z.
Point3 Normalize ( const Point3 )
Remarks
Returns a normalized unit vector. This is a Point3 with each component divided by the point Length().
Point3 FNormalize ( const Point3 )
Remarks
Returns a normalized unit vector using faster assembly language code than that used by Normalize(). This is a Point3 with each component divided by the point Length().
Point3 CrossProd ( const Point3 a,
const Point3 b 
)
Remarks
This returns the cross product of the specified Point3's (vectors). The cross product of two vectors is a third vector, perpendicular to the plane formed by the two vectors.
__forceinline Point3 operator* ( float  f,
const Point3 a 
)
Remarks
Returns a Point3 that is the specified Point3 multiplied by the specified float.
308  {
309  return(Point3(a.x*f, a.y*f, a.z*f));
310  }
float y
Definition: point3.h:54
Definition: point3.h:50
float z
Definition: point3.h:54
float x
Definition: point3.h:54
__forceinline Point3 operator* ( const Point3 a,
float  f 
)
Remarks
Returns a Point3 that is the specified Point3 multiplied by the specified float.
314  {
315  return(Point3(a.x*f, a.y*f, a.z*f));
316  }
float y
Definition: point3.h:54
Definition: point3.h:50
float z
Definition: point3.h:54
float x
Definition: point3.h:54
__forceinline Point3 operator/ ( const Point3 a,
float  f 
)
Remarks
Returns a Point3 that is the specified Point3 divided by the specified float.
320  {
321  DbgAssert(f != 0.0f);
322  return(Point3(a.x/f, a.y/f, a.z/f));
323  }
float y
Definition: point3.h:54
Definition: point3.h:50
float z
Definition: point3.h:54
float x
Definition: point3.h:54
#define DbgAssert(expr)
Definition: assert1.h:74
__forceinline Point3 operator+ ( const Point3 a,
float  f 
)
Remarks
Returns a Point3 that is the specified Point3 with the specified floating point valued added to each component x, y, and z.
327  {
328  return(Point3(a.x+f, a.y+f, a.z+f));
329  }
float y
Definition: point3.h:54
Definition: point3.h:50
float z
Definition: point3.h:54
float x
Definition: point3.h:54
__forceinline float DotProd ( const Point3 a,
const Point3 b 
)
Remarks
Returns the dot product of two Point3s. This is the sum of each of the components multiplied together, element by element a.x*b.x+a.y*b.y+a.z*b.z

The dot product has the property of equaling the product of the magnitude (length) of the two vector times the cosine of the angle between them.
336  {
337  return(a.x*b.x+a.y*b.y+a.z*b.z);
338  }
float y
Definition: point3.h:54
float z
Definition: point3.h:54
float x
Definition: point3.h:54