summaryrefslogtreecommitdiffstats
path: root/src/glpoint.h
blob: 317cc95d8cae04f77d1c96b7fbc7304ca8a73f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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