home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / libray / libobj / bounds.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  1.5 KB  |  62 lines

  1. /*
  2.  * bounds.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * bounds.h,v 4.1 1994/08/09 07:58:08 explorer Exp
  17.  *
  18.  * bounds.h,v
  19.  * Revision 4.1  1994/08/09  07:58:08  explorer
  20.  * Bump version to 4.1
  21.  *
  22.  * Revision 1.1.1.1  1994/08/08  04:52:08  explorer
  23.  * Initial import.  This is a prerelease of 4.0.6enh3, or 4.1 possibly.
  24.  *
  25.  * Revision 4.0  91/07/17  14:36:26  kolb
  26.  * Initial version.
  27.  * 
  28.  */
  29. #ifndef BOUNDS_H
  30. #define BOUNDS_H
  31.  
  32. /*
  33.  * Used to make indices into bounding box arrays more readable.
  34.  */
  35. #define X    0
  36. #define Y    1
  37. #define Z    2
  38. #define LOW    0
  39. #define HIGH    1
  40.  
  41. /*
  42.  * If minimum X is greater than maximum, then
  43.  * is considered to be unbounded.
  44.  */
  45.  
  46. #define UNBOUNDED(o)    ((o)->bounds[LOW][X] > (o)->bounds[HIGH][X])
  47.  
  48. /*
  49.  * Is the point p outside of the bounding box "b"?
  50.  */
  51. #define OutOfBounds(p,b) ((p)->x < b[0][0] || (p)->x > b[1][0] ||\
  52.               (p)->y < b[0][1] || (p)->y > b[1][1] ||\
  53.               (p)->z < b[0][2] || (p)->z > b[1][2])
  54.  
  55. extern void     BoundsCopy(), BoundsPrint(),
  56.         BoundsInit(), BoundsEnlarge(),
  57.         BoundsTransform();
  58. extern void    BoundsEnlargeSphere();
  59.  
  60. extern int    BoundsIntersect();
  61. #endif /* BOUNDS_H */
  62.