GluonGraphics::Math Class Reference

#include <math.h>

List of all members.

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 )

Detailed Description

Utility class containing Math-related methods.

Definition at line 34 of file math.h.


Member Function Documentation

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.

Parameters:
model The object-space matrix. (Object's transformation)
Parameters:
view The view matrix. (Camera's transformation)
Parameters:
projection The projection matrix.

Definition at line 38 of file math.cpp.

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.

Parameters:
image The image to convert.
Parameters:
out An array of unsigned chars to which the data needs to be copied.

Definition at line 44 of file math.cpp.

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.

Parameters:
matrix The QMatrix to convert.
Parameters:
out An array of 16 floats into which the converted matrix will be copied.

Definition at line 27 of file math.cpp.


Member Data Documentation

const QVector3D Math::VECTOR_UNIT_SCALE = QVector3D( 1.f, 1.f, 1.f ) [static]

Default scale vector, (1, 1, 1).

Definition at line 95 of file math.h.

const QVector3D Math::VECTOR_UNIT_X = QVector3D( 1.f, 0.f, 0.f ) [static]

X-axis unit vector, (1, 0, 0).

Definition at line 83 of file math.h.

const QVector3D Math::VECTOR_UNIT_Y = QVector3D( 0.f, 1.f, 0.f ) [static]

Y-axis unit vector, (0, 1, 0).

Definition at line 87 of file math.h.

const QVector3D Math::VECTOR_UNIT_Z = QVector3D( 0.f, 0.f, 1.f ) [static]

Z-axis unit vector, (0, 0, 1).

Definition at line 91 of file math.h.


The documentation for this class was generated from the following files:
Generated on Mon Dec 27 13:13:43 2010 for Gluon by  doxygen 1.6.3