home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / readmap / brush.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-29  |  1.6 KB  |  69 lines

  1. /*======================================================================*/
  2. /* BRUSH.H */
  3.  
  4. #include "mathlib.h"
  5. #include "readmap.h"
  6.  
  7. #define  MAX_FACES               16
  8. #define  BOGUS_RANGE             18000
  9. #define  MAX_POINTS_ON_WINDING   64
  10. #define ON_EPSILON               0.1
  11. #define FP_EPSILON               0.01
  12. #define VECTOR_EPSILON           0.0001
  13. #define SIDE_FRONT               0
  14. #define SIDE_BACK                1
  15. #define SIDE_ON                  2
  16.  
  17. typedef struct
  18. {
  19.         char    texture[16];
  20.         float   rotate;
  21.         float   shift[2];
  22.         float   scale[2];
  23. } texturedef_t;
  24.  
  25. vec3_t  baseaxis[18] =
  26. {
  27. {0,0,1}, {1,0,0}, {0,-1,0},             /* floor */
  28. {0,0,-1}, {1,0,0}, {0,-1,0},            /* ceiling */
  29. {1,0,0}, {0,1,0}, {0,0,-1},             /* west wall */
  30. {-1,0,0}, {0,1,0}, {0,0,-1},            /* east wall */
  31. {0,1,0}, {1,0,0}, {0,0,-1},             /* south wall */
  32. {0,-1,0}, {1,0,0}, {0,0,-1}             /* north wall */
  33. };
  34.  
  35. typedef float   vec5_t[5];
  36.  
  37. typedef struct
  38. {
  39.   int     numpoints;
  40.   vec5_t  points[8];  /*variable sized*/
  41. } winding_t;
  42.  
  43. typedef struct
  44. {
  45.         vec3_t          normal;
  46.         float           dist;
  47. } plane_t;
  48.  
  49. typedef struct
  50. {
  51.   /* implicit representation */
  52.   vec3_t          planepts[3];
  53.   texturedef_t    texture;
  54.  
  55.   /* cached representation */
  56.   plane_t                 plane;
  57.   float                   light;          /* 0 - 1.0 */
  58.   winding_t               *w;
  59. } face_t;
  60.  
  61. float  lightaxis[3] = {1, 0.6, 0.75};
  62.  
  63.  
  64. int        invalid;           /* not a proper polyhedron */
  65. vec3_t     bmins, bmaxs;
  66. face_t     faces[MAX_FACES];
  67. int        numfaces;
  68.  
  69.