]> git.tdb.fi Git - libs/gl.git/blobdiff - source/box.h
Add classes for building some geometric shapes
[libs/gl.git] / source / box.h
diff --git a/source/box.h b/source/box.h
new file mode 100644 (file)
index 0000000..7e4b3e5
--- /dev/null
@@ -0,0 +1,35 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2011  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#ifndef MSP_GL_BOX_H_
+#define MSP_GL_BOX_H_
+
+#include "geometrybuilder.h"
+#include "vector.h"
+
+namespace Msp {
+namespace GL {
+
+class BoxBuilder: public GeometryBuilder
+{
+private:
+       Vector3 origin;
+       Vector3 span;
+
+public:
+       BoxBuilder(float, float, float);
+       BoxBuilder(const Vector3 &, const Vector3 &);
+
+       virtual void build(PrimitiveBuilder &) const;
+private:
+       void build_face(PrimitiveBuilder &, const Vector3 &, const Vector3 &, const Vector3 &) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif