All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DebugPickingController.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "VectorMath.h"
7 #include "Collision.h"
8 #include "Rendering.h"
9 #include "DebugRendering.h"
10 #include "Modules.h"
11 
12 #include <vector>
13 #include <string>
14 
15 namespace Eegeo
16 {
17  namespace Debug
18  {
19  namespace Picking
20  {
22  {
23  enum Mode
24  {
25  Disabled,
26  Pick,
27  PickMesh,
28  MaxModes
29  };
30  public:
32  Rendering::EnvironmentFlatteningService& environmentFlatteningService,
34 
36 
37  void Draw();
38 
39  bool IsEnabled() const { return m_mode != Disabled; }
40  void CycleMode();
41  std::string GetModeDescription() const;
42 
43  void CastRay(const Eegeo::dv3& rayOrigin, const Eegeo::dv3& rayDirection);
44 
45 
46  private:
47  void DebugDrawSubMeshes(std::vector<const Collision::CollisionBvh*>& collisionBvhs, const std::string& collisionMaterialId);
48 
50  Eegeo::DebugRendering::DebugRenderer& m_debugRenderer;
51  Eegeo::dv3 m_spherePosition;
52  Eegeo::v4 m_sphereColour;
53  Eegeo::v3 m_pickSurfaceNormal;
54  Mode m_mode;
55  };
56  }
57  }
58 }