aboutsummaryrefslogtreecommitdiff
path: root/src/ray.cpp
blob: 7bc620102c8ecc157dff0b1fa049bdd5f0e96455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "ray.hpp"

Ray::Ray(Vec3d start, Vec3d direction, bool normalize) {
    m_start = start;
    m_direction = direction;

    if (normalize) {
        m_direction.normalize();
    }
}

Ray::Ray(Vec3d a, Vec3d b) {
    m_start = a;
    m_direction = b - a;

    m_direction.normalize();
}