Ray.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/math/Vector3D.hpp>
9 namespace ege {
10  class Ray;
11  class Element;
12 };
13 #include <ege/physics/Engine.hpp>
14 #include <ememory/memory.hpp>
15 
16 namespace ege {
17  class Ray {
18  public:
24  Ray(const vec3& _origin=vec3(0,0,0), const vec3& _direction=vec3(0,0,1));
28  ~Ray() {};
29  private:
30  vec3 m_origin;
31  public:
36  void setOrigin(const vec3& _origin);
41  const vec3& getOrigin() const {
42  return m_origin;
43  }
44  private:
45  vec3 m_direction;
46  public:
51  void setDirection(const vec3& _direction);
56  const vec3& getDirection() const {
57  return m_direction;
58  }
59  public:
65  void set(const vec3& _origin, const vec3& _direction);
66  public:
67  std::pair<vec3,vec3> testRay(ege::physics::Engine& _engine);
68  std::pair<ememory::SharedPtr<ege::Element>, std::pair<vec3,vec3>> testRayObject(ege::physics::Engine& _engine);
69  vec3 testRayZeroPlane();
70  };
71  std::ostream& operator <<(std::ostream& _os, const ege::Ray& _obj);
72 }
73 
const vec3 & getOrigin() const
Gets the ray&#39;s origin.
Definition: Ray.hpp:41
const vec3 & getDirection() const
Gets the ray&#39;s direction.
Definition: Ray.hpp:56
Definition: AudioElement.hpp:8
Definition: Ray.hpp:17
Definition: Engine.hpp:41
Ray(const vec3 &_origin=vec3(0, 0, 0), const vec3 &_direction=vec3(0, 0, 1))
Contructor.
void setDirection(const vec3 &_direction)
Sets the ray&#39;s direction.
~Ray()
Destructor.
Definition: Ray.hpp:28
void setOrigin(const vec3 &_origin)
Set the ray&#39;s origin.