Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

math_vector.h File Reference

#include <math.h>
#include <assert.h>

Include dependency graph for math_vector.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

class  Bounds
class  idVec2_t
class  idVec3_t
class  idVec5_t
class  vec4_t

Defines

#define __VectorMA(v, s, b, o)   ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))
#define DotProduct4(x, y)   ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3])
#define EQUAL_EPSILON   0.001
#define ID_INLINE   inline
#define SnapVector(v)   {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];}
#define Vector4Copy(a, b)   ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
#define VectorAdd4(a, b, c)   ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3])
#define VectorCopy4(a, b)   ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
#define VectorMA4(v, s, b, o)   ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s))
#define VectorNegate(a, b)   ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2])
#define VectorScale4(v, s, o)   ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s))
#define VectorSubtract4(a, b, c)   ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3])

Functions

double idSqrt (double x)
ID_INLINE idVec3_t operator * (const float a, const idVec3_t b)
float Q_fabs (float f)

Variables

Bounds boundsZero
idVec3_t vec_zero


Define Documentation

#define __VectorMA v,
s,
b,
 )     ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))
 

Definition at line 37 of file math_vector.h.

#define DotProduct4 x,
y   )     ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3])
 

Definition at line 40 of file math_vector.h.

#define EQUAL_EPSILON   0.001
 

Definition at line 59 of file math_vector.h.

#define ID_INLINE   inline
 

Definition at line 68 of file math_vector.h.

#define SnapVector v   )     {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];}
 

Definition at line 53 of file math_vector.h.

#define Vector4Copy a,
 )     ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
 

Definition at line 51 of file math_vector.h.

#define VectorAdd4 a,
b,
 )     ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3])
 

Definition at line 42 of file math_vector.h.

#define VectorCopy4 a,
 )     ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
 

Definition at line 43 of file math_vector.h.

#define VectorMA4 v,
s,
b,
 )     ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s))
 

Definition at line 45 of file math_vector.h.

#define VectorNegate a,
 )     ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2])
 

Definition at line 49 of file math_vector.h.

#define VectorScale4 v,
s,
 )     ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s))
 

Definition at line 44 of file math_vector.h.

#define VectorSubtract4 a,
b,
 )     ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3])
 

Definition at line 41 of file math_vector.h.


Function Documentation

double idSqrt double  x  )  [inline, static]
 

Definition at line 116 of file math_vector.h.

References sqrt(), and x.

Referenced by idVec3_t::Length(), Bounds::Radius(), and idVec3_t::toPitch().

00116                                       {
00117     return sqrt(x);
00118 }

Here is the call graph for this function:

ID_INLINE idVec3_t operator * const float  a,
const idVec3_t  b
 

Definition at line 234 of file math_vector.h.

References a, b, ID_INLINE, idVec3_t::x, idVec3_t::y, and idVec3_t::z.

00234                                                                 {
00235     return idVec3_t( b.x * a, b.y * a, b.z * a );
00236 }

float Q_fabs float  f  ) 
 

Definition at line 574 of file q_math.c.

Referenced by idVec3_t::operator!=(), idVec3_t::operator==(), ProjectDlightTexture(), ProjectPointOnPlane(), and UI_MovedirAdjustment().

00574                         {
00575     int tmp = * ( int * ) &f;
00576     tmp &= 0x7FFFFFFF;
00577     return * ( float * ) &tmp;
00578 }


Variable Documentation

Bounds boundsZero
 

Definition at line 39 of file math_vector.cpp.

idVec3_t vec_zero
 


Generated on Thu Aug 25 15:33:54 2005 for Quake III Arena by  doxygen 1.3.9.1