Walls And Holes  1
DrawableAxes Class Reference

An object that may be added to a Scene to display the XYZ axes. More...

#include <drawableaxes.h>

Inheritance diagram for DrawableAxes:
Collaboration diagram for DrawableAxes:

Public Member Functions

 DrawableAxes ()
 
void initializeGL () override
 Called when this object is to be used with a new OpenGL context. Must be called before the first draw() call in the context. More...
 
void draw (QMatrix4x4 projection, QMatrix4x4 transformation) override
 Performs OpenGL calls to draw the object, assuming a context is bound. More...
 
- Public Member Functions inherited from AbstractDrawableGLObject
virtual ~AbstractDrawableGLObject ()
 

Protected Attributes

QSharedPointer< QOpenGLVertexArrayObject > mVAO
 
QSharedPointer< QOpenGLBuffer > mPos
 
QSharedPointer< QOpenGLBuffer > mColor
 
QSharedPointer< QOpenGLShaderProgram > mProgram
 

Detailed Description

An object that may be added to a Scene to display the XYZ axes.

DrawableAxes always draws itself at (0, 0, 0). It does not disable depth testing, so the axes could be completely covered up by a large object.

Constructor & Destructor Documentation

◆ DrawableAxes()

DrawableAxes::DrawableAxes ( )

Member Function Documentation

◆ draw()

void DrawableAxes::draw ( QMatrix4x4  projection,
QMatrix4x4  transformation 
)
overridevirtual

Performs OpenGL calls to draw the object, assuming a context is bound.

Parameters
projectionThe projection matrix used for the meshes.
transformationThe transformation matrix used for the meshes. The purpose of separating this from the projection is to allow a user to extract the translation and rotation components.

The gl_Position of a vertex V is given by (projection * transformation * V).

Implements AbstractDrawableGLObject.

◆ initializeGL()

void DrawableAxes::initializeGL ( )
overridevirtual

Called when this object is to be used with a new OpenGL context. Must be called before the first draw() call in the context.

Implements AbstractDrawableGLObject.

Member Data Documentation

◆ mColor

QSharedPointer<QOpenGLBuffer> DrawableAxes::mColor
protected

◆ mPos

QSharedPointer<QOpenGLBuffer> DrawableAxes::mPos
protected

◆ mProgram

QSharedPointer<QOpenGLShaderProgram> DrawableAxes::mProgram
protected

◆ mVAO

QSharedPointer<QOpenGLVertexArrayObject> DrawableAxes::mVAO
protected

The documentation for this class was generated from the following files: