]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/box.h
Beginnings of a geometry library
[libs/math.git] / source / geometry / box.h
diff --git a/source/geometry/box.h b/source/geometry/box.h
new file mode 100644 (file)
index 0000000..bfcfa2f
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef MSP_GEOMETRY_BOX_H_
+#define MSP_GEOMETRY_BOX_H_
+
+#include <msp/linal/vector3.h>
+#include "hyperbox.h"
+
+namespace Msp {
+namespace Geometry {
+
+template<typename T>
+class Box: public HyperBox<T, 3>
+{
+public:
+       Box() { }
+       explicit Box(const LinAl::Vector<T, 3> &d): HyperBox<T, 3>(d) { }
+       Box(T w, T h, T d): HyperBox<T, 3>(LinAl::Vector3<T>(w, h, d)) { }
+
+       T get_width() const { return this->get_dimension(0); }
+       T get_height() const { return this->get_dimension(1); }
+       T get_depth() const { return this->get_dimension(2); }
+};
+
+} // namespace Geometry
+} // namespace Msp
+
+#endif