forked from funkey/util
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplane.hpp
40 lines (27 loc) · 790 Bytes
/
plane.hpp
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
#ifndef UTIL_PLANE_H__
#define UTIL_PLANE_H__
namespace util {
template <typename T, int N>
class plane {
public:
plane() {}
plane(
const util::point<T,N>& position,
const util::point<T,N>& normal) :
_position(position),
_normal(normal) {}
const util::point<T,N>& position() const { return _position; }
const util::point<T,N>& normal() const { return _normal; }
util::point<T,N>& position() { return _position; }
util::point<T,N>& normal() { return _normal; }
private:
util::point<T,N> _position;
util::point<T,N> _normal;
};
template <typename T, int N>
std::ostream& operator<<(std::ostream& os, const util::plane<T,N>& plane) {
os << "{" << plane.position() << ": " << plane.normal() << "}";
return os;
}
} // namespace util
#endif // UTIL_PLANE_H__