Cafu Engine
SceneView3D.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_MODELEDITOR_SCENE_VIEW_3D_HPP_INCLUDED
8 #define CAFU_MODELEDITOR_SCENE_VIEW_3D_HPP_INCLUDED
9 
10 #include "../Generic3DWindow.hpp"
11 #include "Models/Model_cmdl.hpp"
12 #include "Renderer3D.hpp"
13 
14 
15 namespace MatSys { class RenderMaterialT; }
16 
17 
18 namespace ModelEditor
19 {
20  class ChildFrameT;
21 
22 
24  {
25  public:
26 
27  SceneView3DT(ChildFrameT* Parent);
28 
29  Vector3fT TraceCameraRay(const wxPoint& RefPtWin, AnimPoseT::TraceResultT& ModelTR) const;
30 
31 
32  private:
33 
34  // Implement virtual methods of Generic3DViewT base class.
35  virtual Vector3fT GetRefPtWorld(const wxPoint& RefPtWin) const;
36  virtual void InfoCameraChanged();
37  virtual void InfoRightMouseClick(wxMouseEvent& ME);
38 
39  /// Renders the skeleton of the model with the given joints and matrices.
40  void RenderSkeleton(const ArrayT<CafuModelT::JointT>& Joints, const ArrayT<MatrixT>& Matrices, bool IsSubModel) const;
41 
42  /// Renders a single pass of the scene.
43  void RenderPass() const;
44 
45  ChildFrameT* m_Parent;
46  Renderer3DT m_Renderer; ///< Performs the 3D rendering in our window.
47  unsigned long m_TimeOfLastPaint; ///< The time at which the OnPaint() event handler was last called.
48  ArrayT<bool> m_JointSelCache; ///< Stores for each joint whether it is currently selected, updated every frame.
49 
50  // Event handlers.
51  void OnKeyDown (wxKeyEvent& KE);
52  void OnMouseLeftDown(wxMouseEvent& ME); ///< We also handle "double-click" events in this method (use ME.ButtonDClick() for distinction).
53  void OnMouseLeftUp (wxMouseEvent& ME);
54  void OnMouseMove (wxMouseEvent& ME);
55  void OnContextMenu (wxContextMenuEvent& CE);
56  void OnPaint (wxPaintEvent& PE);
57  void OnIdle (wxIdleEvent& IE);
58 
59  DECLARE_EVENT_TABLE()
60  };
61 }
62 
63 #endif
Definition: ChildFrame.hpp:35
This class represents a child frame.
Definition: ChildFrame.hpp:55
This class provides auxiliary means for rendering a 3D scene view of the model editor.
Definition: Renderer3D.hpp:24
This class implements a generic 3D window.
Definition: Generic3DWindow.hpp:20
This class describes the result of tracing a ray or a bounding box against the model.
Definition: AnimPose.hpp:60
Definition: SceneView3D.hpp:23