]> git.tdb.fi Git - libs/gl.git/blobdiff - source/grid.h
Add capsule and grid builders
[libs/gl.git] / source / grid.h
diff --git a/source/grid.h b/source/grid.h
new file mode 100644 (file)
index 0000000..91b9ef2
--- /dev/null
@@ -0,0 +1,44 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2011  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#ifndef MSP_GL_GRID_H_
+#define MSP_GL_GRID_H_
+
+#include "geometrybuilder.h"
+#include "vector.h"
+
+namespace Msp {
+namespace GL {
+
+class GridBuilder: public GeometryBuilder
+{
+private:
+       Vector3 origin;
+       Vector3 side1;
+       Vector3 side2;
+       Vector3 norm;
+       Vector3 binorm;
+       unsigned u_div;
+       unsigned v_div;
+       float u_origin;
+       float y_origin;
+
+public:
+       GridBuilder(float, float, unsigned = 4, unsigned = 4);
+       GridBuilder(const Vector3 &, const Vector3 &, unsigned = 4, unsigned = 4);
+       GridBuilder(const Vector3 &, const Vector3 &, const Vector3 &, unsigned = 4, unsigned = 4);
+private:
+       void init(bool);
+
+public:
+       virtual void build(PrimitiveBuilder &) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif