home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / raytrace / radiance / simplerd.lha / simplerad / FinalFTP / Light / scull.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-21  |  2.7 KB  |  75 lines

  1. /**********************************************************************/
  2. /* scull.h                                                            */
  3. /*                                                                    */
  4. /* Constants and definitions for shaft culling                        */
  5. /*                                                                    */
  6. /* Copyright (C) 1992, Bernard Kwok                                   */
  7. /* All rights reserved.                                               */
  8. /* Revision 1.0                                                       */
  9. /* May, 1992                                                          */
  10. /**********************************************************************/
  11. #define MINX 0             /* Flags for reference list creation */
  12. #define MINY 1
  13. #define MINZ 2
  14. #define MAXX 3
  15. #define MAXY 4
  16. #define MAXZ 5
  17.  
  18. #define OUTSIDE 0          /* Flags for candidate list creation */
  19. #define OVERLAP 1
  20. #define INSIDE 2
  21. #define CONTAINS 3
  22.  
  23. #define HBOX -1
  24. #define Candidate_type(cand) ((cand)->object == NULL ? HBOX \
  25.                   : (cand)->object->primid)
  26.  
  27. typedef struct {           /* Reference list */
  28.   int dir[6];              /* X,Y or Z  0,1,2 = min(X,Y,Z), 
  29.                   3,4,5 = max(X,Y,Z) dir[i] = FALSE means 
  30.                   not represented */
  31.   double pt[6];            
  32. } RefListtype;
  33.  
  34. typedef struct {           /* Plane set = shaft */
  35.   Plane planes[8];         /* Up to 8 possible planes for culling shaft */
  36.   int num_planes;          /* Number of planes in plane set */  
  37. } PlaneSettype;
  38.  
  39. #define KEEP_CLOSED  0     /* Shaft strategies */
  40. #define ALWAYS_OPEN  1
  41. #define OVERLAP_OPEN 2
  42. #define RATIO_OPEN   3
  43.  
  44. typedef struct {           /* Shaft statisitics */
  45.   int strategy;            /* shaft-box strategy */
  46.   double ratio_open;       /* Ratio to open, if use this strategy */
  47.   int BoxIn, BoxOut,       /* Boxes in, out, overlapping, and boxes tested */
  48.   BoxOverlap, BoxContains,
  49.   BoxTests;          
  50.   int candCube, candSphere, candCone,
  51.   candMesh, candCyl, candHbox;
  52.   int candidates;          /* Size of Candidate list */
  53.   int total_shafts;        /* Total shafts formed */
  54.   int total_candidates;    /* Total candidates for shafts */
  55.   int total_BoxIn,         /* Total boxes in, out, overlap, containing, and */
  56.   total_BoxOut,            /* tests */
  57.   total_BoxOverlap, 
  58.   total_BoxContains,
  59.   total_BoxTests;
  60.   
  61. } ShaftStatstype;
  62.  
  63. /**********************************************************************/
  64. /* Prototypes */
  65. /**********************************************************************/
  66. void Form_Extent_Culledges();
  67. void Form_Plane_Set();
  68. void Form_Culling_Shaft();
  69. int isCandidate();
  70. int Form_Candidate_List();
  71.  
  72. extern void StartShaft();
  73. extern void ShaftCull();
  74. extern void EndShaft();
  75.