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.

83 lines
2.5 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: logobj.hxx
  3. *
  4. * Copyright (c) 1997 Microsoft Corporation
  5. *
  6. \**************************************************************************/
  7. #ifndef __logobj_hxx__
  8. #define __logobj_hxx__
  9. #include "mtk.hxx"
  10. #if 1
  11. #define OBJECT_WIDTH 2.6f
  12. #else
  13. #define OBJECT_WIDTH 3.535f // so object is 256 pixels wide, looks good
  14. //#define OBJECT_WIDTH 1.7675f // object 128 pixels : ugly
  15. #endif
  16. #define FRAME_SIZE (0.05f * OBJECT_WIDTH)
  17. #define FRAME_DEPTH 0.1f
  18. class LOG_OBJECT {
  19. public:
  20. FSIZE fImageSize; // size of image part of object
  21. float fCurContextWidth; // current width of context part of object
  22. float fMaxContextWidth; // max width of context part of object
  23. FSIZE fFrameSize; // size of frame around object (offset value)
  24. float fFrameDepth;
  25. TEXTURE *pTex;
  26. LOG_OBJECT();
  27. ~LOG_OBJECT();
  28. void ShowContext( BOOL bShow );
  29. void ShowFrame( BOOL bShow );
  30. void SetDest( float x, float y, float z );
  31. void SetDest( POINT3D *pDest );
  32. void OffsetDest( float x, float y, float z );
  33. void SetContextSize( float fPortion );
  34. void SetImageSize( FSIZE *pSize );
  35. void SetTexture( TEXTURE *pTexture );
  36. void GetDest( POINT3D *pDest );
  37. void GetRect( GLIRECT *pRect );
  38. int GetIter() { return iter; };
  39. // void GetPos( POINT3D *curpos );
  40. void Translate();
  41. void Rotate();
  42. BOOL NextFlyIteration();
  43. void Draw();
  44. void Draw( BOOL bUpdateWinRect );
  45. void ResetMotion();
  46. void SetDampedFlyMotion( float deviation );
  47. void SetDampedFlyMotion( float deviation, POINT3D *pOffset );
  48. void CalcWinRect();
  49. private:
  50. void CalcWinRect( BOOL bTransform );
  51. void CalcCoords();
  52. void CalcFrameCoords();
  53. void CalcTexCoords();
  54. void CalcFrameNormals();
  55. void DrawFace();
  56. void DrawFrame();
  57. float dest[3]; // destination position (current if offset = 0)
  58. float offset[3]; // offset from destination
  59. float rotAxis[3];
  60. float ang;
  61. int iter; // fly iterations
  62. GLIRECT rect; // Bounds rectangle (GL coords : bl=origin)
  63. BOOL bShowContext;
  64. BOOL bFramed;
  65. POINT3D point[8]; // current coords of object (object space)
  66. POINT3D frameNormal[4]; // normals for the frame
  67. TEX_POINT2D texPoint[4]; // tex coords for front face texture
  68. };
  69. #endif // __logobj_hxx__