-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRay.h
More file actions
47 lines (35 loc) · 929 Bytes
/
Copy pathRay.h
File metadata and controls
47 lines (35 loc) · 929 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Tyrus Malmstrom
// Header file for the Ray.cpp
#ifndef RAY_H_INCLUDE
#define RAY_H_INCLUDE
// directives:
#include <iostream>
#include <limits>
#include <vector>
#include <Eigen/Dense>
using std::cout;
using std::ostream;
using std::endl;
using std::vector;
using Eigen::Vector3d;
class Ray{
public:
// Defualt Constructor:
Ray(): origin( Vector3d() ), direction( Vector3d() ) {};
Ray(const Vector3d& origin_, const Vector3d& direction_):
origin( origin_ ), direction( direction_ ) {};
// pprint member function:
void pprint(ostream& out = cout) const;
// copy assignment operator: 1 of the BIG THREE
const Ray& operator= (const Ray& rhs){
if( this != &rhs ){ // Standard alias test...
origin = rhs.origin;
direction = rhs.direction;
}
return *this;
}
Vector3d origin;
Vector3d direction;
};
ostream& operator<< (ostream& out, const Ray& r);
#endif // RAY_H_INCLUDE