]> git.tdb.fi Git - libs/math.git/blob - source/geometry/box.h
Beginnings of a geometry library
[libs/math.git] / source / geometry / box.h
1 #ifndef MSP_GEOMETRY_BOX_H_
2 #define MSP_GEOMETRY_BOX_H_
3
4 #include <msp/linal/vector3.h>
5 #include "hyperbox.h"
6
7 namespace Msp {
8 namespace Geometry {
9
10 template<typename T>
11 class Box: public HyperBox<T, 3>
12 {
13 public:
14         Box() { }
15         explicit Box(const LinAl::Vector<T, 3> &d): HyperBox<T, 3>(d) { }
16         Box(T w, T h, T d): HyperBox<T, 3>(LinAl::Vector3<T>(w, h, d)) { }
17
18         T get_width() const { return this->get_dimension(0); }
19         T get_height() const { return this->get_dimension(1); }
20         T get_depth() const { return this->get_dimension(2); }
21 };
22
23 } // namespace Geometry
24 } // namespace Msp
25
26 #endif