frustrum.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _frustrum_h_ /* Is this your first time? */
  2. #define _frustrum_h_ 1
  3. #include "kshape.h"
  4. /*
  5. * KJL 15:13:43 7/17/97 - frustrum.h
  6. *
  7. * function prototypes & pointers for things connected
  8. * to the view frustrum and clipping
  9. *
  10. */
  11. enum FrustrumType
  12. {
  13. FRUSTRUM_TYPE_NORMAL,
  14. FRUSTRUM_TYPE_WIDE
  15. };
  16. extern void SetFrustrumType(enum FrustrumType frustrumType);
  17. /* GOURAUD POLYGON CLIPPING */
  18. extern void GouraudPolygon_ClipWithZ(void);
  19. extern void (*GouraudPolygon_ClipWithNegativeX)(void);
  20. extern void (*GouraudPolygon_ClipWithPositiveY)(void);
  21. extern void (*GouraudPolygon_ClipWithNegativeY)(void);
  22. extern void (*GouraudPolygon_ClipWithPositiveX)(void);
  23. /* TEXTURED POLYGON CLIPPING */
  24. extern void TexturedPolygon_ClipWithZ(void);
  25. extern void (*TexturedPolygon_ClipWithNegativeX)(void);
  26. extern void (*TexturedPolygon_ClipWithPositiveY)(void);
  27. extern void (*TexturedPolygon_ClipWithNegativeY)(void);
  28. extern void (*TexturedPolygon_ClipWithPositiveX)(void);
  29. /* GOURAUD TEXTURED POLYGON CLIPPING */
  30. extern void GouraudTexturedPolygon_ClipWithZ(void);
  31. extern void (*GouraudTexturedPolygon_ClipWithNegativeX)(void);
  32. extern void (*GouraudTexturedPolygon_ClipWithPositiveY)(void);
  33. extern void (*GouraudTexturedPolygon_ClipWithNegativeY)(void);
  34. extern void (*GouraudTexturedPolygon_ClipWithPositiveX)(void);
  35. /* FRUSTRUM TESTS */
  36. extern int PolygonWithinFrustrum(POLYHEADER *polyPtr);
  37. extern int PolygonShouldBeDrawn(POLYHEADER *polyPtr);
  38. extern int (*ObjectWithinFrustrum)(DISPLAYBLOCK *dbPtr);
  39. extern int (*ObjectCompletelyWithinFrustrum)(DISPLAYBLOCK *dbPtr);
  40. extern int (*VertexWithinFrustrum)(RENDERVERTEX *vertexPtr);
  41. extern void (*TestVerticesWithFrustrum)(void);
  42. extern int DecalWithinFrustrum(DECAL *decalPtr);
  43. extern int QuadWithinFrustrum(void);
  44. extern int TriangleWithinFrustrum(void);
  45. /* pass a pointer to a vertex to be tested; results are returned in an int,
  46. using the following defines */
  47. #define INSIDE_FRUSTRUM_Z_PLANE 1
  48. #define INSIDE_FRUSTRUM_PX_PLANE 2
  49. #define INSIDE_FRUSTRUM_NX_PLANE 4
  50. #define INSIDE_FRUSTRUM_PY_PLANE 8
  51. #define INSIDE_FRUSTRUM_NY_PLANE 16
  52. #define INSIDE_FRUSTRUM 31
  53. extern char FrustrumFlagForVertex[maxrotpts];
  54. #define USE_FOV_53 0
  55. #endif