Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
ray.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 Ray: public AbstractShape {
13 public:
14  Ray(const glm::vec3& origin, const glm::vec3& direction);
15 
16  const glm::vec3& origin() const;
17  void setOrigin(const glm::vec3& origin);
18 
19  const glm::vec3& direction() const;
20  void setDirection(const glm::vec3& direction);
21 
22  virtual bool intersects(const Sphere& sphere) const override;
23  virtual bool nearTo(const TAABB<int>& aabb) const override;
24  virtual bool containedBy(const TAABB<int>& aabb) const override;
25 
26  static Ray fromTo(const glm::vec3& from, const glm::vec3& to);
27 
28 
29 protected:
30  glm::vec3 m_origin;
31  glm::vec3 m_direction;
32 };
Definition: transform.h:9
Definition: aabb.h:15
Definition: sphere.h:11
Definition: ray.h:12
Definition: abstractshape.h:7