Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.3 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: fpipe.h
  3. *
  4. * Flexy pipe stuff
  5. *
  6. * Copyright (c) 1995 Microsoft Corporation
  7. *
  8. \**************************************************************************/
  9. #ifndef __fpipe_h__
  10. #define __fpipe_h__
  11. #include "sscommon.h"
  12. #include "sspipes.h"
  13. #include "pipe.h"
  14. #include "state.h"
  15. #include "eval.h"
  16. #include "xc.h"
  17. // continuity types
  18. enum {
  19. CONT_1 = 0,
  20. CONT_2
  21. };
  22. // cap types
  23. enum {
  24. START_CAP = 0,
  25. END_CAP
  26. };
  27. #define CIRCUMFERENCE( r ) \
  28. ( 2.0f * PI * ((GLfloat) r) )
  29. // drawing schemes
  30. enum {
  31. SC_EXTRUDED_XC,
  32. SC_TURNOMANIA,
  33. SC_VARIABLE_XC,
  34. SC_COUNT
  35. };
  36. #define TURNOMANIA_PIPE_COUNT 10
  37. /**************************************************************************\
  38. *
  39. * FLEX_PIPE class
  40. *
  41. * - Pipe has position and direction in node array
  42. *
  43. \**************************************************************************/
  44. class FLEX_PIPE : public PIPE {
  45. public:
  46. void SetTexParams( TEXTURE *pTex, IPOINT2D *pTexRep );
  47. protected:
  48. XC *xcCur, *xcEnd; // current xc, end xc
  49. EVAL *pEval;
  50. GLfloat zTrans; // pos'n of pipe back along current dir,
  51. // from current node
  52. FLEX_PIPE( STATE *state );
  53. ~FLEX_PIPE();
  54. void ChooseXCProfile();
  55. void DrawExtrudedXCObject( float length );
  56. void DrawXCElbow( int newDir, float radius );
  57. void DrawCap( int type );
  58. private:
  59. int nSlices; // intended # of slices around an xc (based
  60. // on tessLevel)
  61. int tangent; // current tangent at curXC (usually PLUS_Z)
  62. GLfloat s_start, s_end;
  63. GLfloat t_start, t_end;
  64. GLfloat s_length; // length in WC's of texture width
  65. GLfloat evalDivSize; // ~size in WC's of an eval division
  66. void CalcEvalLengthParams( float length );
  67. };
  68. class REGULAR_FLEX_PIPE : public FLEX_PIPE {
  69. public:
  70. float turnFactorMin; // describes degree of bend in an elbow
  71. float turnFactorMax; // [0-1]
  72. REGULAR_FLEX_PIPE( STATE *state );
  73. void Start();
  74. void Draw();
  75. };
  76. class TURNING_FLEX_PIPE : public FLEX_PIPE {
  77. public:
  78. TURNING_FLEX_PIPE( STATE *state );
  79. void Start();
  80. void Draw();
  81. };
  82. #endif // __fpipe_h__