summaryrefslogtreecommitdiffstats
path: root/src/glpoint.h
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-10-06 12:52:40 +0200
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-10-06 12:53:07 +0200
commitaf64f953d4f01a7c7bd3415ff5edfff8d4f7c48d (patch)
treeee6060a549c311ffa02b4a604bd9059f0465b237 /src/glpoint.h
downloadMultimedia-af64f953d4f01a7c7bd3415ff5edfff8d4f7c48d.tar.gz
Multimedia-af64f953d4f01a7c7bd3415ff5edfff8d4f7c48d.zip
Initial commit
Diffstat (limited to 'src/glpoint.h')
-rw-r--r--src/glpoint.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/glpoint.h b/src/glpoint.h
new file mode 100644
index 0000000..317cc95
--- /dev/null
+++ b/src/glpoint.h
@@ -0,0 +1,45 @@
+#ifndef GLPOINT_H
+#define GLPOINT_H
+#include <QVector3D>
+#include "glcolorrgba.h"
+// ----------------------------------------------------------------------------
+class GLPoint {
+ public : GLPoint( const QVector3D & vertex = QVector3D (0.0, 0.0, 0.0),
+ const QVector3D & normal = QVector3D (0.0, 1.0, 0.0),
+ const QVector3D & texCoord = QVector3D (0.0, 0.0, 0.0),
+ const GLColorRgba & color = GLColorRgba(1.0, 1.0, 1.0, 1.0) );
+ ~GLPoint();
+
+ QVector3D * vertexPointer (); // Returns address of vertex coordinate
+ QVector3D * normalPointer (); // Returns address of normal coordinate
+ QVector3D * texCoordPointer(); // Returns address of texture coordinate
+ QVector4D * colorPointer (); // Returns address of color
+
+ void move( QVector3D vMove );
+
+ private: QVector3D vertex;
+ QVector3D normal;
+ QVector3D texCoord;
+ GLColorRgba color ;
+}; /* ----- end of class GLPoint ----- */
+
+inline QVector3D * GLPoint::vertexPointer() {
+ return & vertex;
+} /* ----- end of method vertexPointer ----- */
+
+inline QVector3D * GLPoint::normalPointer() {
+ return & normal;
+} /* ----- end of method normalPointer ----- */
+
+inline QVector3D * GLPoint::texCoordPointer() {
+ return & texCoord;
+} /* ----- end of method texCoordPointer ----- */
+
+inline QVector4D * GLPoint::colorPointer() {
+ return (QVector4D *) & color;
+} /* ----- end of method colorPointer ----- */
+
+inline void GLPoint::move( QVector3D vMove ) {
+ vertex = vertex + vMove;
+} /* ----- end of method move ----- */
+#endif // GLPOINT_H