home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Homebrewer's Handbook / vr.iso / vr386 / splitdef.h < prev    next >
C/C++ Source or Header  |  1996-03-19  |  3KB  |  84 lines

  1. /* Splitting-tree structures: theory by Dave Stampe, initial
  2.    implementation by Bernie Roehl */
  3.  
  4. // HARDLY NEEDED NOW since code is now properly organized
  5. // This could be used for debugging, include before any
  6. // other file
  7.  
  8. /*
  9.  This code is part of the VR-386 project, created by Dave Stampe.
  10.  VR-386 is a desendent of REND386, created by Dave Stampe and
  11.  Bernie Roehl.  Almost all the code has been rewritten by Dave
  12.  Stampre for VR-386.
  13.  
  14.  Copyright (c) 1994 by Dave Stampe:
  15.  May be freely used to write software for release into the public domain
  16.  or for educational use; all commercial endeavours MUST contact Dave Stampe
  17.  (dstampe@psych.toronto.edu) for permission to incorporate any part of
  18.  this software or source code into their products!  Usually there is no
  19.  charge for under 50-100 items for low-cost or shareware products, and terms
  20.  are reasonable.  Any royalties are used for development, so equipment is
  21.  often acceptable payment.
  22.  
  23.  ATTRIBUTION:  If you use any part of this source code or the libraries
  24.  in your projects, you must give attribution to VR-386 and Dave Stampe,
  25.  and any other authors in your documentation, source code, and at startup
  26.  of your program.  Let's keep the freeware ball rolling!
  27.  
  28.  DEVELOPMENT: VR-386 is a effort to develop the process started by
  29.  REND386, improving programmer access by rewriting the code and supplying
  30.  a standard API.  If you write improvements, add new functions rather
  31.  than rewriting current functions.  This will make it possible to
  32.  include you improved code in the next API release.  YOU can help advance
  33.  VR-386.  Comments on the API are welcome.
  34.  
  35.  CONTACT: dstampe@psych.toronto.edu
  36. */
  37.  
  38.  
  39.  
  40. #ifndef SPLITDEF
  41. typedef struct _split SPLIT;
  42.  
  43. struct _split {
  44.     long x, y, z;    /* a point in the splitting plane */
  45.     long nx, ny, nz; /* the normal vector to the splitting plane */
  46.     OBJLIST *olist;  /* list of objects making up this split */
  47.     unsigned flags;
  48.     char left_type;  /* indicates what the left pointer points to */
  49.     char right_type; /* indicates what the right pointer points to */
  50. #define ISSPLIT    0
  51. #define ISAREA     1
  52. #define ISOBJLIST  2
  53.     void *left, *right; /* can point to a split, an area or an objlists */
  54.     };
  55.  
  56. #define SPLITDEF 1
  57. #endif
  58.  
  59. #ifndef AREADEF
  60. typedef struct _area AREA;
  61. #endif
  62.  
  63. typedef struct _area_ref AREA_REF; /* element in a list of area pointers */
  64.  
  65. struct _area_ref {
  66.     AREA *area;
  67.     AREA_REF *next;
  68.     };
  69.  
  70. #ifndef AREADEF
  71. struct _area {
  72.     long floor_a, floor_b, floor_c, floor_d; /* ax + y + cx + d = 0 */
  73.     long ceiling_a, ceiling_b, ceiling_c, ceiling_d; /* ax + y + cx + d = 0 */
  74.     void (*fn)(AREA *);
  75.     AREA_REF *visfrom;
  76.     int has_tree : 1;
  77.     void *ptr;
  78.     char *name;
  79.     };
  80. #define AREADEF 1
  81. #endif
  82.  
  83. /* End of splitdef.h */
  84.