Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
capsule.h
1 #pragma once
2 
3 #include <glm/glm.hpp>
4 
5 #include "abstractshape.h"
6 
7 
8 class Sphere;
9 class Transform;
10 template<typename T> class TAABB;
11 
12 class Capsule : public AbstractShape {
13 public:
14  Capsule();
15  Capsule(const glm::vec3& origin, const glm::vec3& direction, const float radius);
16 
17  const glm::vec3& origin() const;
18  void setOrigin(const glm::vec3& origin);
19 
20  const glm::vec3& direction() const;
21  void setDirection(const glm::vec3& direction);
22 
23  const float radius() const;
24  void setRadius(const float radius);
25 
26  virtual bool intersects(const Sphere& sphere) const override;
27  virtual bool nearTo(const TAABB<int>& aabb) const override;
28  virtual bool containedBy(const TAABB<int>& aabb) const override;
29 
30 
31 protected:
32  glm::vec3 m_origin;
33  glm::vec3 m_direction;
34  float m_radius;
35 };
36 
Definition: transform.h:9
Definition: aabb.h:15
Definition: sphere.h:11
Definition: capsule.h:12
Definition: abstractshape.h:7