Classes | Typedefs | Functions

point3.h File Reference

This reference page is linked to from the following overview topics: Vertex Color Information, Texture Coordinates.


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

Go to the source code of this file.

Classes

class   Point3
class   Ray

Typedefs

typedef Point3  UVVert
typedef Point3  VertColor

Functions

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

Typedef Documentation

typedef Point3 UVVert

Definition at line 338 of file point3.h.

typedef Point3 VertColor

Definition at line 339 of file point3.h.


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)

Definition at line 236 of file point3.h.

                                     { 
   return v.Length();
   }
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)

Definition at line 240 of file point3.h.

                                      {   
   return v.FLength();
   }
float LengthSquared ( const Point3 v ) [inline]
Remarks:
The 'Length' squared of the point. This is v.x*v.x+v.y*v.y+v.z*v.z.

Definition at line 244 of file point3.h.

                                            {   
   return v.LengthSquared();
   }
GEOMEXPORT int MaxComponent ( const Point3 )
Remarks:
Returns the component with the maximum absolute value. 0=x, 1=y, 2=z.
GEOMEXPORT int MinComponent ( const Point3 )
Remarks:
Returns the component with the minimum absolute value. 0=x, 1=y, 2=z.
GEOMEXPORT Point3 Normalize ( const Point3 )
Remarks:
Returns a normalized unit vector. This is a Point3 with each component divided by the point Length().
GEOMEXPORT 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().
GEOMEXPORT 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.
Point3 operator* ( float  f,
const Point3 a 
) [inline]
Remarks:
Returns a Point3 that is the specified Point3 multiplied by the specified float.

Definition at line 303 of file point3.h.

                                                  {
   return(Point3(a.x*f, a.y*f, a.z*f));
   }
Point3 operator* ( const Point3 a,
float  f 
) [inline]
Remarks:
Returns a Point3 that is the specified Point3 multiplied by the specified float.

Definition at line 309 of file point3.h.

                                                  {
   return(Point3(a.x*f, a.y*f, a.z*f));
   }
Point3 operator/ ( const Point3 a,
float  f 
) [inline]
Remarks:
Returns a Point3 that is the specified Point3 divided by the specified float.

Definition at line 315 of file point3.h.

                                                  {
   DbgAssert(f != 0.0f);
   return(Point3(a.x/f, a.y/f, a.z/f));
   }
Point3 operator+ ( const Point3 a,
float  f 
) [inline]
Remarks:
Returns a Point3 that is the specified Point3 with the specified floating point valued added to each component x, y, and z.

Definition at line 322 of file point3.h.

                                                  {
   return(Point3(a.x+f, a.y+f, a.z+f));
   }
float DotProd ( const Point3 a,
const Point3 b 
) [inline]
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.

Definition at line 331 of file point3.h.

                                                       { 
   return(a.x*b.x+a.y*b.y+a.z*b.z); 
   }