-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ray.h
28 lines (23 loc) · 777 Bytes
/
Ray.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _RAY_H_
#define _RAY_H_
#include "GLInclude.h"
//terminal says it needs this??
#include <memory>
////////////////////////////////////////////////////////////////////////////////
/// @brief Ray
////////////////////////////////////////////////////////////////////////////////
struct Ray {
Ray(const glm::vec3 _o,
const glm::vec3 _d) :
m_origin(_o), m_direction(_d) {}
//////////////////////////////////////////////////////////////////////////////
/// @brief Get a point along the ray
/// @param _t Distance along ray
/// @return Point at @c _t distance along the ray
glm::vec3 at(float _t) const {
return m_origin + _t * m_direction;
}
glm::vec3 m_origin; ///< Source of ray
glm::vec3 m_direction; ///< Direction of ray
};
#endif