You.i Engine
YiRay.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_RAY_H_
3 #define _YI_RAY_H_
4 
5 #include "framework/YiPredef.h"
6 
7 #include <glm/fwd.hpp>
8 #include <glm/vec3.hpp>
9 
32 class CYIRay
33 {
34 public:
35  CYIRay();
36  CYIRay(const glm::vec3 &rStart, const glm::vec3 &rEnd);
37 
41  void Create(const glm::vec3 &start, const glm::vec3 &end);
42 
46  CYIRay Transform(const glm::mat4 &matrix) const;
47 
51  const glm::vec3 &GetOrigin() const;
52 
56  const glm::vec3 &GetUnit() const;
57 
61  const glm::vec3 &GetOneOverUnit() const;
62 
63 private:
67  glm::vec3 m_origin;
68 
72  glm::vec3 m_unit;
73 
77  glm::vec3 m_oneOverUnit;
78 };
79 
82 inline const glm::vec3 &CYIRay::GetOrigin() const
83 {
84  return m_origin;
85 }
86 
87 inline const glm::vec3 &CYIRay::GetUnit() const
88 {
89  return m_unit;
90 }
91 
92 inline const glm::vec3 &CYIRay::GetOneOverUnit() const
93 {
94  return m_oneOverUnit;
95 }
96 
97 #endif // _YI_RAY_H_
CYIRay Transform(const glm::mat4 &matrix) const
void Create(const glm::vec3 &start, const glm::vec3 &end)
const glm::vec3 & GetOneOverUnit() const
Definition: YiRay.h:92
Encapsulates the origin and direction points of a ray.
Definition: YiRay.h:32
const glm::vec3 & GetUnit() const
Definition: YiRay.h:87
const glm::vec3 & GetOrigin() const
Definition: YiRay.h:82