From af64f953d4f01a7c7bd3415ff5edfff8d4f7c48d Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Tue, 6 Oct 2015 12:52:40 +0200 Subject: Initial commit --- src/glpoint.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/glpoint.h (limited to 'src/glpoint.h') 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 +#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 -- cgit v1.2.3-70-g09d2