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.

107 lines
2.7 KiB

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