Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
aimhelperhudget.h
1 #pragma once
2 
3 #include <memory>
4 
5 #include <glm/glm.hpp>
6 
7 #include "geometry/range.h"
8 
9 #include "circularhudget.h"
10 
11 
12 class HUD;
13 class WorldObject;
15 
16 /*
17  Hudget drawn where player-bullets and target
18  will collide i.e. not actually on the hud-sphere but
19  in the world
20 */
22 public:
23  AimHelperHudget(HUD* hud);
24  virtual ~AimHelperHudget();
25 
26  /*
27  The point the player should shoot at to hit
28  his current enemy
29  */
30  const glm::vec3& targetPoint() const;
31 
32  virtual void update(float deltaSec) override;
33  virtual void draw();
34  virtual bool isAt(const Ray& ray) const override;
35 
36 protected:
37  std::unique_ptr<AimHelperHudgetVoxels> m_voxels;
38 
39  glm::vec3 m_targetPoint;
40  glm::vec3 m_smoothTargetPoint;
41 
42  WorldObject* m_lastTargetWorldObject;
43  bool m_lastVisible;
44 
45  Range m_distanceRange;
46 
47  void calculateTargetPoint(WorldObject* targetObject);
48  void calculatedDirection();
49 };
50 
Definition: circularhudget.h:9
Definition: worldobject.h:43
Definition: aimhelperhudget.h:21
Definition: range.h:3
Definition: aimhelperhudgetvoxels.h:9
Definition: hud.h:34
Definition: ray.h:12