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