doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions | Variables
Vector.h File Reference

Go to the source code of this file.

Classes

class  idVec2
 
class  idVec3
 
class  idVec4
 
class  idVec5
 
class  idVec6
 
class  idVecX
 
class  idPolar3
 

Macros

#define VECTOR_EPSILON   0.001f
 
#define vec2_zero   vec2_origin
 
#define vec3_zero   vec3_origin
 
#define vec4_zero   vec4_origin
 
#define vec5_zero   vec5_origin
 
#define vec6_zero   vec6_origin
 
#define VECX_MAX_TEMP   1024
 
#define VECX_QUAD(x)   ( ( ( ( x ) + 3 ) & ~3 ) * sizeof( float ) )
 
#define VECX_CLEAREND()   int s = size; while( s < ( ( s + 3) & ~3 ) ) { p[s++] = 0.0f; }
 
#define VECX_ALLOCA(n)   ( (float *) _alloca16( VECX_QUAD( n ) ) )
 
#define VECX_SIMD
 
#define DotProduct(a, b)   ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])
 
#define VectorSubtract(a, b, c)   ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
 
#define VectorAdd(a, b, c)   ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2])
 
#define VectorScale(v, s, o)   ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s))
 
#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 VectorCopy(a, b)   ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2])
 

Functions

ID_INLINE idVec2 operator* (const float a, const idVec2 b)
 
ID_INLINE idVec3 operator* (const float a, const idVec3 b)
 
ID_INLINE idVec4 operator* (const float a, const idVec4 b)
 
ID_INLINE idVec6 operator* (const float a, const idVec6 b)
 
ID_INLINE idVecX operator* (const float a, const idVecX b)
 

Variables

idVec2 vec2_origin
 
idVec3 vec3_origin
 
idVec4 vec4_origin
 
idVec5 vec5_origin
 
idVec6 vec6_origin
 
idVec6 vec6_infinity
 

Macro Definition Documentation

#define DotProduct (   a,
  b 
)    ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])

Definition at line 1994 of file Vector.h.

#define vec2_zero   vec2_origin

Definition at line 104 of file Vector.h.

#define vec3_zero   vec3_origin

Definition at line 390 of file Vector.h.

#define vec4_zero   vec4_origin

Definition at line 861 of file Vector.h.

#define vec5_zero   vec5_origin

Definition at line 1094 of file Vector.h.

#define vec6_zero   vec6_origin

Definition at line 1205 of file Vector.h.

#define VECTOR_EPSILON   0.001f

Definition at line 40 of file Vector.h.

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

Definition at line 1996 of file Vector.h.

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

Definition at line 1999 of file Vector.h.

#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 1998 of file Vector.h.

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

Definition at line 1997 of file Vector.h.

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

Definition at line 1995 of file Vector.h.

#define VECX_ALLOCA (   n)    ( (float *) _alloca16( VECX_QUAD( n ) ) )

Definition at line 1432 of file Vector.h.

#define VECX_CLEAREND ( )    int s = size; while( s < ( ( s + 3) & ~3 ) ) { p[s++] = 0.0f; }

Definition at line 1431 of file Vector.h.

#define VECX_MAX_TEMP   1024

Definition at line 1429 of file Vector.h.

#define VECX_QUAD (   x)    ( ( ( ( x ) + 3 ) & ~3 ) * sizeof( float ) )

Definition at line 1430 of file Vector.h.

#define VECX_SIMD

Definition at line 1433 of file Vector.h.

Function Documentation

ID_INLINE idVec2 operator* ( const float  a,
const idVec2  b 
)

Definition at line 253 of file Vector.h.

ID_INLINE idVec3 operator* ( const float  a,
const idVec3  b 
)

Definition at line 447 of file Vector.h.

ID_INLINE idVec4 operator* ( const float  a,
const idVec4  b 
)

Definition at line 913 of file Vector.h.

ID_INLINE idVec6 operator* ( const float  a,
const idVec6  b 
)

Definition at line 1304 of file Vector.h.

ID_INLINE idVecX operator* ( const float  a,
const idVecX  b 
)

Definition at line 1660 of file Vector.h.

Variable Documentation

idVec2 vec2_origin
idVec3 vec3_origin
idVec4 vec4_origin
idVec5 vec5_origin
idVec6 vec6_infinity
idVec6 vec6_origin