00001
00002
00003
00004
00005 #if !defined(AFX_VirtualHumanVIEW_H__2DC375FA_13A6_4A8D_ABC1_344D836C16E0__INCLUDED_)
00006 #define AFX_VirtualHumanVIEW_H__2DC375FA_13A6_4A8D_ABC1_344D836C16E0__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #include <WinBasis/WBMMTimer.h>
00013 #include <Graphics/GRRender.h>
00014 #include <Graphics/GRCamera.h>
00015 #include <ImpD3D/D3FileDoc.h>
00016 #include <ImpD3D/D3DocNode.h>
00017 #include <Physics/PHSolid.h>
00018 #include <Physics/PHContactEngine.h>
00019 #include <HIS/HIMouse.h>
00020 #include <Framework/FWPointer.h>
00021
00022
00023 class CMFCD3DDynaView : public CView
00024 {
00025 protected:
00026 CMFCD3DDynaView();
00027 DECLARE_DYNCREATE(CMFCD3DDynaView)
00028
00029 public:
00030 float dt;
00031 Spr::UTRef<Spr::GRRender> render;
00032 Spr::UTRef<Spr::SGScene> scene;
00033 std::string loadFile;
00034 std::string loadFileName;
00035 Spr::GRCameraData initialCamera;
00036 Spr::UTRef<Spr::PHContactEngine> contactEngine;
00037
00038 Spr::WBMMTimer timer;
00039 UINT simTimerID;
00040 UINT drawTimerID;
00041 volatile bool bUpdate;
00042
00043 Spr::UTRef<Spr::HIMouse> mouse;
00044 Spr::FWPointer6D pointer;
00045 bool bMinForce;
00046
00047 void Import(std::string filename);
00048 void Load(std::string filename);
00049 void Save(std::string filename);
00050 void Step();
00051 void UpdateMouse();
00052 void ThrowSphere(float r);
00053
00054 CMFCD3DDynaDoc* GetDocument();
00055
00056 public:
00057
00058
00059
00060
00061 public:
00062 virtual void OnDraw(CDC* pDC);
00063 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00064 virtual void OnInitialUpdate();
00065 virtual BOOL PreTranslateMessage(MSG* pMsg);
00066
00067
00068
00069 public:
00070 virtual ~CMFCD3DDynaView();
00071 #ifdef _DEBUG
00072 virtual void AssertValid() const;
00073 virtual void Dump(CDumpContext& dc) const;
00074 #endif
00075 protected:
00076
00077
00078 protected:
00079
00080 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00081 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00082 afx_msg void OnTimer(UINT nIDEvent);
00083 afx_msg void OnDestroy();
00084 afx_msg void OnRenderD3d();
00085 afx_msg void OnRenderGl();
00086 afx_msg void OnFileInsert();
00087
00088 DECLARE_MESSAGE_MAP()
00089 };
00090
00091 #ifndef _DEBUG // VirtualHumanView.cpp ファイルがデバッグ環境の時使用されます。
00092 inline CMFCD3DDynaDoc* CMFCD3DDynaView::GetDocument()
00093 { return (CMFCD3DDynaDoc*)m_pDocument; }
00094 #endif
00095
00096
00097
00098
00099
00100
00101 #endif