9 Ray::Ray(ngl::Vec3 _origin, ngl::Vec3 _direction)
14 if (_direction.length() > 1.1 || _direction.length() < 0.9) {_direction.normalize();}
22 ngl::Vec3 direction = _B - _A;
23 direction.normalize();
35 if (_direction.length() > 1.1 || _direction.length() < 0.9) {_direction.normalize();}
void setDirection(ngl::Vec3 _direction)
Setter method for the direction.
ngl::Vec3 getOrigin()
Getter method for the origin.
ngl::Vec3 m_origin
Ray's origin class member.
~Ray()
Simple destructor. Frees memory.
void setOrigin(ngl::Vec3 _origin)
Setter method for the origin.
ngl::Vec3 m_direction
Ray's direction class member.
Ray(ngl::Vec3 _origin, ngl::Vec3 _direction)
First ray ctor, this takes an origin and a direction and passes them directly to the class members...
This class handles the implementation of ray: an object with an origin and a direction.
ngl::Vec3 getDirection()
Getter method for the direction.