#include <math.h>
Static Public Member Functions | |
static void | qmatrixToGLMatrix (const QMatrix4x4 &matrix, float *out) |
static QMatrix4x4 | calculateModelViewProj (const QMatrix4x4 &model, const QMatrix4x4 &view, const QMatrix4x4 &projection) |
static void | qImageToGL (const QImage &image, uchar *out) |
Static Public Attributes | |
static const QVector3D | VECTOR_UNIT_X = QVector3D( 1.f, 0.f, 0.f ) |
static const QVector3D | VECTOR_UNIT_Y = QVector3D( 0.f, 1.f, 0.f ) |
static const QVector3D | VECTOR_UNIT_Z = QVector3D( 0.f, 0.f, 1.f ) |
static const QVector3D | VECTOR_UNIT_SCALE = QVector3D( 1.f, 1.f, 1.f ) |
Utility class containing Math-related methods.
Definition at line 34 of file math.h.
QMatrix4x4 Math::calculateModelViewProj | ( | const QMatrix4x4 & | model, | |
const QMatrix4x4 & | view, | |||
const QMatrix4x4 & | projection | |||
) | [static] |
Calculate a Model-View-Projection matrix.
This type of matrix is used to transform vertices into screen space prior to rendering.
model | The object-space matrix. (Object's transformation)
|
void Math::qImageToGL | ( | const QImage & | image, | |
uchar * | out | |||
) | [static] |
Convert a QImage to an array of unsigned chars.
This method will convert a 32 bits ARGB QImage to an RGBA array of unsigned chars.
Note that this method is mostly a workaround for stuff lacking from Qt.
image | The image to convert.
|
void Math::qmatrixToGLMatrix | ( | const QMatrix4x4 & | matrix, | |
float * | out | |||
) | [static] |
Convert a QMatrix4x4 to a float array.
This will convert a QMatrix4x4 to an array of 16 floats which can be used by OpenGL's matrix functions, most notably glUniformMatrix4fv.
Note that this method is mostly a workaround for stuff lacking from Qt.
matrix | The QMatrix to convert.
|
const QVector3D Math::VECTOR_UNIT_SCALE = QVector3D( 1.f, 1.f, 1.f ) [static] |
const QVector3D Math::VECTOR_UNIT_X = QVector3D( 1.f, 0.f, 0.f ) [static] |
const QVector3D Math::VECTOR_UNIT_Y = QVector3D( 0.f, 1.f, 0.f ) [static] |
const QVector3D Math::VECTOR_UNIT_Z = QVector3D( 0.f, 0.f, 1.f ) [static] |