BCYL.H 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /****************************************************************************
  2. * bcyl.h
  3. *
  4. * This module contains all defines, typedefs, and prototypes for BCYL.C.
  5. *
  6. * from Persistence of Vision(tm) Ray Tracer
  7. * Copyright 1996,1999 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. * NOTICE: This source code file is provided so that users may experiment
  10. * with enhancements to POV-Ray and to port the software to platforms other
  11. * than those supported by the POV-Ray Team. There are strict rules under
  12. * which you are permitted to use this file. The rules are in the file
  13. * named POVLEGAL.DOC which should be distributed with this file.
  14. * If POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. * Team Coordinator by email to team-coord@povray.org or visit us on the web at
  16. * http://www.povray.org. The latest version of POV-Ray may be found at this site.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23. #ifndef BCYL_H
  24. #define BCYL_H
  25. /*****************************************************************************
  26. * Global preprocessor defines
  27. ******************************************************************************/
  28. /* Generate additional bcyl statistics. */
  29. #define BCYL_EXTRA_STATS 1
  30. /*****************************************************************************
  31. * Global typedefs
  32. ******************************************************************************/
  33. typedef struct BCyl_Struct BCYL;
  34. typedef struct BCyl_Entry_Struct BCYL_ENTRY;
  35. typedef struct BCyl_Intersection_Struct BCYL_INT;
  36. struct BCyl_Intersection_Struct
  37. {
  38. int n; /* Number of cylinder hit */
  39. DBL d[2]; /* Intersection distance(s) */
  40. DBL w[2]; /* Intersection parameter(s) */
  41. };
  42. struct BCyl_Entry_Struct
  43. {
  44. short r1, r2; /* Index of min/max segment radius */
  45. short h1, h2; /* Index of min/max segmnet height */
  46. };
  47. struct BCyl_Struct
  48. {
  49. int number; /* Number of bounding cylinders. */
  50. short nradius; /* Number of different bound-radii. */
  51. short nheight; /* Number of different bound-heights. */
  52. DBL *radius; /* List of different bound-radii. */
  53. DBL *height; /* List of different bound-heights. */
  54. BCYL_INT *rint; /* BCyl intersections list. */
  55. BCYL_INT *hint; /* BCyl intersections list. */
  56. BCYL_INT *intervals; /* BCyl intersection intervals. */
  57. BCYL_ENTRY *entry; /* BCyl elements. */
  58. };
  59. /*****************************************************************************
  60. * Global variables
  61. ******************************************************************************/
  62. /*****************************************************************************
  63. * Global functions
  64. ******************************************************************************/
  65. BCYL *Create_BCyl (int, DBL *, DBL *, DBL *, DBL *);
  66. void Destroy_BCyl (BCYL *);
  67. int Intersect_BCyl (BCYL *BCyl, VECTOR P, VECTOR D);
  68. #endif