Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
hardpointaimhelper.h
1 #pragma once
2 
3 #include <glm/glm.hpp>
4 
5 
6 class Hardpoint;
7 class Vpxel;
8 class WorldObject;
9 
16 public:
17  HardpointAimHelper(Hardpoint* hardpoint, WorldObject* targetObject);
18 
19  void aim();
20 
21  /*
22  For some reason it might be impossible to hit the target
23  (e.g. ship faster than bullet) then this will return false.
24  direction() and point() are invalid then.
25  */
26  bool isHitable();
27 
28  const glm::vec3& direction();
29  const glm::vec3& point();
30 
31 
32 protected:
33  Hardpoint* m_hardpoint;
34  WorldObject* m_targetObject;
35 
36  bool m_aimed;
37 
38  glm::vec3 m_hardpointPosition;
39 
40  glm::vec3 m_targetPosition;
41  glm::vec3 m_targetSpeed;
42 
43  float m_bulletSpeed;
44  float m_bulletLifetime;
45 
46  bool m_hitable;
47 
48  glm::vec3 m_direction;
49  glm::vec3 m_point;
50 
51 
52  float bulletTravelTime(const glm::vec3& point);
53  glm::vec3 targetPositionIn(float deltaSec);
54  float bulletSpeedInDirection(const glm::vec3& direction);
55 };
56 
Definition: worldobject.h:43
Definition: hardpointaimhelper.h:15
Definition: hardpoint.h:18