home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 8090 / ModelEdit.7z / RenderWnd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-03-08  |  4.3 KB  |  173 lines

  1. #if !defined(AFX_RENDERWND_H__07339643_2849_11D1_9462_0020AFF7CDC1__INCLUDED_)
  2. #define AFX_RENDERWND_H__07339643_2849_11D1_9462_0020AFF7CDC1__INCLUDED_
  3.  
  4. #if _MSC_VER >= 1000
  5. #pragma once
  6. #endif // _MSC_VER >= 1000
  7. // RenderWnd.h : header file
  8. //
  9.  
  10.  
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CRenderWnd window
  13. #include "ltaModel.h"
  14.  
  15. #include "bdefs.h"
  16. #include "model.h"
  17. #include "gl_modelrender.h"
  18. #include "animtracker.h"
  19.  
  20.  
  21.  
  22. class CLocator
  23. {
  24.     public:
  25.             
  26.                 CLocator();
  27.  
  28.         void    UpdateLocation();
  29.         void    Center();
  30.  
  31.         float            m_nDistance;
  32.         float            m_nXZAngle;
  33.         float            m_nYAngle;
  34.         CVector            m_Offset;
  35.         CVector            m_Location;
  36.         CVector            m_Orientation, m_Up, m_Right;
  37. };
  38.  
  39.  
  40. class CCamera
  41. {
  42. public:
  43.     CCamera();
  44.     void Update();
  45.     void Reset();
  46.     void LookAtPoint( const LTVector& lookAt );
  47.  
  48.     float m_fXZAngle;
  49.     float m_fYAngle;
  50.     LTVector m_Offset;
  51.  
  52.     LTVector m_Position;
  53.     LTVector m_LookAt;
  54.     LTVector m_Direction;
  55.     LTVector m_Right;
  56.     LTVector m_Up;
  57. };
  58.  
  59.  
  60. class CModelEditDlg;
  61. class CSetFOVDlg;   // feild of view dialog
  62.  
  63. // ------------------------------------------------------------------------
  64. // CRenderWnd
  65. // the render window.
  66. // ------------------------------------------------------------------------
  67. class CRenderWnd : public CWnd
  68. {
  69. // Construction
  70. public:
  71.     CRenderWnd();
  72.  
  73. // Attributes
  74. public:
  75.  
  76. // Operations
  77. public:
  78.  
  79.     // Initialize the animation pointers.  These POINTERS are stored in RenderWnd.
  80.     void            InitAnims(LTAnimTracker *pTrackers[NUM_ANIM_INFOS]);
  81.  
  82.     void            Draw();
  83.     void            SetLOD(DWORD iLOD)        {m_DrawStruct.m_iLOD = iLOD;}
  84.     void            SetLOD( float flod )    {m_DrawStruct.m_CurrentLODDist = flod ; }
  85.     Model*            GetModel()                {return m_DrawStruct.GetModel();}
  86.  
  87.     BOOL            SetupTransformMaker(TransformMaker *pMaker);
  88.  
  89.     void            ResetLocator();
  90.     void            ResetLights();
  91.     GLM_CONTEXT        GetContext() {return m_hContext;}
  92.     
  93.     CLocator        m_LightLocators[MAX_GLM_LIGHTS];
  94.     CCamera            m_Camera;
  95.  
  96.     void            OpenFOVDlg();
  97.     
  98.     void            SetFOV( int val );
  99.     void            ReleaseAllTextures();
  100.     BOOL            SetTexture( TextureData *pTexture, DWORD nTextures );
  101.     void            SetBackgroundColor( COLORREF  ms_color );
  102.  
  103.     void            AllocSelections( uint32 pieces,uint32 nodes ){
  104.         m_SelectedPieces.SetSizeInit2(pieces, 0);
  105.         m_SelectedNodes.SetSizeInit2(nodes, 0);
  106.     }
  107.  
  108.     // Helps movement with small models.
  109.     float            m_Scale;
  110.  
  111. protected:
  112.  
  113. // Overrides
  114.     // ClassWizard generated virtual function overrides
  115.     //{{AFX_VIRTUAL(CRenderWnd)
  116.     //}}AFX_VIRTUAL
  117.  
  118. // Implementation
  119. public:
  120.     virtual ~CRenderWnd();
  121.  
  122.     int GetSelectedPiecesSize() { return m_SelectedPieces.GetSize() ; }
  123.     int GetSelectedNodesSize() { return m_SelectedNodes.GetSize() ; }
  124.     CMoByteArray    m_SelectedPieces;
  125.     CMoByteArray    m_SelectedNodes;
  126.  
  127.     // Generated message map functions
  128. protected:
  129.     //{{AFX_MSG(CRenderWnd)
  130.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  131.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  132.     afx_msg void OnDestroy();
  133.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  134.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  135.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  136.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  137.     afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  138.     afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
  139.     afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
  140.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  141.     //}}AFX_MSG
  142.     DECLARE_MESSAGE_MAP()
  143.  
  144.     GLM_CONTEXT        m_hContext;
  145.     CSetFOVDlg     *m_pSetFOVDlg ;  // modeless dialog for dynamically setting the field of view on renderwnd.
  146.  
  147. public:
  148.  
  149.     AnimTracker        *m_pTrackers[NUM_ANIM_INFOS];
  150.     
  151.     CModelEditDlg    *m_pModelEditDlg;
  152.     DrawStruct        m_DrawStruct;
  153.     
  154.     BOOL            m_bCameraFollow;
  155.  
  156.  
  157.     BOOL            m_bTracking;
  158.     CPoint            m_ptTracking;
  159.     CPoint            m_ptTrackingScreen;
  160.  
  161.     // variables used for calculating internal radius by looping through all animation frames
  162.     bool            m_bCalcRadius;
  163.     float            m_fCurRadius;
  164.     bool            m_bCalcAndDraw;
  165. };
  166.  
  167. /////////////////////////////////////////////////////////////////////////////
  168.  
  169. //{{AFX_INSERT_LOCATION}}
  170. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  171.  
  172. #endif // !defined(AFX_RENDERWND_H__07339643_2849_11D1_9462_0020AFF7CDC1__INCLUDED_)
  173.