Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
objecthudget.h
1 #pragma once
2 
3 #include <memory>
4 
5 #include <glm/glm.hpp>
6 #include <glm/gtx/quaternion.hpp>
7 
8 #include "hudget.h"
9 
10 
11 class ObjectHudgetVoxels;
12 class HUDObjectDelegate;
13 class ArrowHudgetVoxels;
14 
15 class ObjectHudget: public Hudget {
16 public:
17  ObjectHudget(HUD* hud);
18  virtual ~ObjectHudget();
19 
20  virtual void update(float deltaSec) override;
21  virtual void draw() override;
22 
23  virtual bool isAt(const Ray& ray) const override;
24 
25  virtual void onClick(ClickType clickType) override;
26 
27  HUDObjectDelegate* objectDelegate();
28  void setObjectDelegate(HUDObjectDelegate* objectDelegate);
29 
30 
31 protected:
32  HUDObjectDelegate* m_objectDelegate;
33  std::unique_ptr<ObjectHudgetVoxels> m_objectVoxels;
34  std::unique_ptr<ArrowHudgetVoxels> m_arrowVoxels;
35 
36  bool m_targeted;
37  void updateTargeted();
38 
39  bool m_insideFov;
40  float m_fovy, m_fovx;
41 
42  bool isInsideFov();
43  glm::vec3 closestPointInsideFov();
44 
45  void calculateOpeningAngle();
46 
47  void updateFov();
48 };
49 
Definition: hudget.h:15
Definition: objecthudgetvoxels.h:13
Definition: arrowhudgetvoxels.h:12
Definition: hudobjectdelegate.h:15
Definition: hud.h:34
Definition: objecthudget.h:15
Definition: ray.h:12