home *** CD-ROM | disk | FTP | other *** search
/ Qu-ake / Qu-ake.iso / qu_ke / editor / 017 / MATHLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-12  |  1.2 KB  |  39 lines

  1. /*-------------------------------------------------------------------------
  2. File    : mathlib.h
  3. Author  : Cameron Newham
  4. Version : 1.0
  5. Date    : 96/08/29
  6.  
  7. Description
  8. -----------
  9. The header file for the mathlib.c library.
  10.  
  11. Comments
  12. --------
  13. This is modelled on the mathlib.h by John Carmack (id Software).
  14.  
  15. -------------------------------------------------------------------------*/
  16.  
  17. typedef float vec_t;
  18. typedef vec_t vec3_t[3];
  19.  
  20. extern vec3_t vec3_origin;
  21.  
  22. int VectorCompare (vec3_t v1, vec3_t v2);
  23. vec_t DotProduct (vec3_t v1, vec3_t v2);
  24. void VectorSubtract (vec3_t va, vec3_t vb, vec3_t out);
  25. void VectorAdd (vec3_t va, vec3_t vb, vec3_t out);
  26. void VectorCopy (vec3_t in, vec3_t out);
  27.  
  28. void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
  29. void VectorNormalize (vec3_t v);
  30. void VectorScale (vec3_t v, vec_t scale, vec3_t out);
  31. double VectorLength(vec3_t v); 
  32. //Just about everything in this program uses float, not sure why VectorMA
  33. //was looking for double, changed it to float for scale and eliminated
  34. //compiler warnings and type conversion.
  35. //It works but it probably affected the algorithm. (;->
  36. //11-12-96
  37. void VectorMA (vec3_t va, float scale, vec3_t vb, vec3_t vc); //double
  38.  
  39.