Basic Image AlgorithmS Library
2.8.0
|
A 4x4 matrix in native OpenGL format. More...
#include <OpenGLFramework/Base/glfMatrix.hh>
Public Member Functions | |
const GLfloat * | GetArray () const |
glfMatrix () | |
The constructor leaves the matrix undefined! More... | |
glfMatrix (GLfloat m0, GLfloat m1, GLfloat m2, GLfloat m3, GLfloat m4, GLfloat m5, GLfloat m6, GLfloat m7, GLfloat m8, GLfloat m9, GLfloat m10, GLfloat m11, GLfloat m12, GLfloat m13, GLfloat m14, GLfloat m15) | |
Constructor that initializes the entries of the matrix. More... | |
virtual void | Load () const |
Loads the matrix in OpenGL. More... | |
void | MakeAffineInverse (const glfMatrix &a) |
Computes the inverse of the matrix, assuming it is an affine transformation with an orthonormal linear part. More... | |
virtual | ~glfMatrix () |
Initialization methods similar to glIdentity, glRotate etc. | |
void | MakeIdentity () |
void | MakeRotation (GLfloat angle, GLfloat x, GLfloat y, GLfloat z) |
void | MakeTranslation (GLfloat x, GLfloat y, GLfloat z) |
void | MakeScalation (GLfloat x, GLfloat y, GLfloat z) |
void | MakeFrustum (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal) |
void | MakeOrtho (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal) |
void | MakePerspective (GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar) |
void | MakeLookAt (GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, GLfloat centerX, GLfloat centerY, GLfloat centerZ, GLfloat upX, GLfloat upY, GLfloat upZ) |
void | Make (const Matrix4x4< float > &a) |
Initializes the glf matrix from a BIAS matrix. More... | |
void | Make (const Matrix4x4< double > &a) |
void | MakeAffine (const Matrix3x3< float > &r, const Vector3< float > &t) |
Initializes the render matrix as an affine mapping. More... | |
void | MakeAffine (const Matrix3x3< double > &r, const Vector3< double > &t) |
void | MakeTextureMatrix (const ProjectionParametersPerspective ¶ms, bool flip=false) |
Conversion from ProjectionParametersPerspective . More... | |
void | MakeViewMatrix (const ProjectionParametersBase ¶ms) |
void | MakeViewMatrixNew (const ProjectionParametersBase ¶ms) |
void | MakeProjectionMatrix (const ProjectionParametersPerspective ¶ms, GLfloat nearZZ, GLfloat farZ, bool useIdealK=false) |
void | MakeProjectionMatrix (ProjectionParametersPerspective params, GLfloat nearZ, GLfloat farZ, unsigned int x0, unsigned int y0, unsigned int width, unsigned int height, bool useIdealK=false) |
void | MakeProjectionMatrixNew (const ProjectionParametersPerspective ¶ms, GLfloat nearZ, GLfloat farZ, unsigned int x0, unsigned int y0, unsigned int width, unsigned int height, bool useIdealK=false, bool flip=false) |
void | MakeProjectionMatrixNew (const ProjectionParametersPerspective ¶ms, GLfloat nearZ, GLfloat farZ, bool flip=false) |
void | MakeTextureMatrixNew (const ProjectionParametersPerspective ¶ms, bool flip) |
void | TransformPoint (const Vector3< float > &in, Vector3< float > &out) const |
Transforms a point by the matrix. More... | |
void | TransformPoint (const Vector3< double > &in, Vector3< double > &out) const |
Matrix multiplications. | |
void | Multiply (const glfMatrix &a) |
void | operator*= (const glfMatrix &a) |
glfMatrix | operator* (const glfMatrix &a) |
void | Multiply (Vector4< float > vIn, Vector4< float > &vOut) |
void | Multiply (Vector4< double > vIn, Vector4< double > &vOut) |
Static Public Member Functions | |
static unsigned int | Matrix2DIndexToRep (unsigned int row, unsigned int column) |
Static Public Attributes | |
static const glfMatrix | IDENTITY |
The identity matrix. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &s, const glfMatrix &m) |
A 4x4 matrix in native OpenGL format.
Definition at line 41 of file glfMatrix.hh.
glfMatrix::glfMatrix | ( | ) |
The constructor leaves the matrix undefined!
Definition at line 57 of file glfMatrix.cpp.
glfMatrix::glfMatrix | ( | GLfloat | m0, |
GLfloat | m1, | ||
GLfloat | m2, | ||
GLfloat | m3, | ||
GLfloat | m4, | ||
GLfloat | m5, | ||
GLfloat | m6, | ||
GLfloat | m7, | ||
GLfloat | m8, | ||
GLfloat | m9, | ||
GLfloat | m10, | ||
GLfloat | m11, | ||
GLfloat | m12, | ||
GLfloat | m13, | ||
GLfloat | m14, | ||
GLfloat | m15 | ||
) |
Constructor that initializes the entries of the matrix.
Definition at line 61 of file glfMatrix.cpp.
|
inlinevirtual |
Definition at line 57 of file glfMatrix.hh.
|
inline |
Definition at line 171 of file glfMatrix.hh.
Referenced by BIAS::glfShaderProgram::SetUniform().
|
virtual |
Loads the matrix in OpenGL.
Reimplemented in BIAS::glfPassiveRenderMatrix.
Definition at line 540 of file glfMatrix.cpp.
Referenced by BIAS::GLProjectionParametersPerspective::UpdateGLProjectionMatrix_().
void glfMatrix::Make | ( | const Matrix4x4< float > & | a | ) |
Initializes the glf matrix from a BIAS matrix.
Definition at line 193 of file glfMatrix.cpp.
Referenced by Make(), MakeProjectionMatrix(), MakeProjectionMatrixNew(), MakeTextureMatrix(), MakeTextureMatrixNew(), MakeViewMatrix(), and MakeViewMatrixNew().
void glfMatrix::Make | ( | const Matrix4x4< double > & | a | ) |
Definition at line 201 of file glfMatrix.cpp.
References Make().
Initializes the render matrix as an affine mapping.
Definition at line 206 of file glfMatrix.cpp.
Referenced by MakeAffine().
Definition at line 214 of file glfMatrix.cpp.
References MakeAffine().
void glfMatrix::MakeAffineInverse | ( | const glfMatrix & | a | ) |
Computes the inverse of the matrix, assuming it is an affine transformation with an orthonormal linear part.
Definition at line 219 of file glfMatrix.cpp.
void glfMatrix::MakeFrustum | ( | GLfloat | left, |
GLfloat | right, | ||
GLfloat | bottom, | ||
GLfloat | top, | ||
GLfloat | nearVal, | ||
GLfloat | farVal | ||
) |
Definition at line 115 of file glfMatrix.cpp.
void glfMatrix::MakeIdentity | ( | ) |
Definition at line 72 of file glfMatrix.cpp.
References IDENTITY.
Referenced by BIAS::PlainPerPixelProcessing::InitVertexTransformation_(), and BIAS::TemplateSpecializedBatch::InitVertexTransformation_().
void glfMatrix::MakeLookAt | ( | GLfloat | eyeX, |
GLfloat | eyeY, | ||
GLfloat | eyeZ, | ||
GLfloat | centerX, | ||
GLfloat | centerY, | ||
GLfloat | centerZ, | ||
GLfloat | upX, | ||
GLfloat | upY, | ||
GLfloat | upZ | ||
) |
Definition at line 162 of file glfMatrix.cpp.
References BIAS::Vector3< T >::CrossProduct(), MakeTranslation(), and BIAS::Vector3< T >::Normalize().
void glfMatrix::MakeOrtho | ( | GLfloat | left, |
GLfloat | right, | ||
GLfloat | bottom, | ||
GLfloat | top, | ||
GLfloat | nearVal, | ||
GLfloat | farVal | ||
) |
Definition at line 131 of file glfMatrix.cpp.
void glfMatrix::MakePerspective | ( | GLfloat | fovy, |
GLfloat | aspect, | ||
GLfloat | zNear, | ||
GLfloat | zFar | ||
) |
Definition at line 147 of file glfMatrix.cpp.
void glfMatrix::MakeProjectionMatrix | ( | const ProjectionParametersPerspective & | params, |
GLfloat | nearZZ, | ||
GLfloat | farZ, | ||
bool | useIdealK = false |
||
) |
Definition at line 292 of file glfMatrix.cpp.
References BIAS::ProjectionParametersPerspective::GetIdealImageSize(), and BIAS::ProjectionParametersBase::GetImageSize().
void glfMatrix::MakeProjectionMatrix | ( | ProjectionParametersPerspective | params, |
GLfloat | nearZ, | ||
GLfloat | farZ, | ||
unsigned int | x0, | ||
unsigned int | y0, | ||
unsigned int | width, | ||
unsigned int | height, | ||
bool | useIdealK = false |
||
) |
Definition at line 407 of file glfMatrix.cpp.
References BIAS::ProjectionParametersPerspective::GetIdealK(), BIAS::HomgPoint2D, Make(), BIAS::ProjectionParametersPerspective::SetK(), BIAS::Matrix< T >::SetZero(), and BIAS::ProjectionParametersPerspective::UnProjectLocal().
void glfMatrix::MakeProjectionMatrixNew | ( | const ProjectionParametersPerspective & | params, |
GLfloat | nearZ, | ||
GLfloat | farZ, | ||
unsigned int | x0, | ||
unsigned int | y0, | ||
unsigned int | width, | ||
unsigned int | height, | ||
bool | useIdealK = false , |
||
bool | flip = false |
||
) |
Definition at line 314 of file glfMatrix.cpp.
References BIAS::ProjectionParametersPerspective::GetIdealK(), BIAS::ProjectionParametersPerspective::GetK(), Make(), and BIAS::Matrix< T >::SetZero().
Referenced by MakeProjectionMatrixNew(), and BIAS::GLProjectionParametersPerspective::UpdateGLProjectionMatrix_().
void glfMatrix::MakeProjectionMatrixNew | ( | const ProjectionParametersPerspective & | params, |
GLfloat | nearZ, | ||
GLfloat | farZ, | ||
bool | flip = false |
||
) |
Definition at line 305 of file glfMatrix.cpp.
References BIAS::ProjectionParametersBase::GetImageSize(), and MakeProjectionMatrixNew().
void glfMatrix::MakeRotation | ( | GLfloat | angle, |
GLfloat | x, | ||
GLfloat | y, | ||
GLfloat | z | ||
) |
Definition at line 77 of file glfMatrix.cpp.
void glfMatrix::MakeScalation | ( | GLfloat | x, |
GLfloat | y, | ||
GLfloat | z | ||
) |
Definition at line 107 of file glfMatrix.cpp.
void glfMatrix::MakeTextureMatrix | ( | const ProjectionParametersPerspective & | params, |
bool | flip = false |
||
) |
Conversion from ProjectionParametersPerspective
.
flip | has to be used if a gl rendered texture is used but BIAS ProjectionParameters, since up and down interpretation is the other way around (got it?). flip does not have to be true if an BIAS image is uploaded without a previous call to BIAS::ImageBase::Flip(). (However it afterall depends on what you want to achieve!) |
Definition at line 231 of file glfMatrix.cpp.
References BIAS::CoordinateTransform3D::GetGlobalToLocalTransform(), BIAS::ProjectionParametersBase::GetImageSize(), BIAS::ProjectionParametersPerspective::GetK(), BIAS::ProjectionParametersBase::GetPose(), Make(), BIAS::Matrix4x4< T >::Mult(), and BIAS::Matrix< T >::SetZero().
void glfMatrix::MakeTextureMatrixNew | ( | const ProjectionParametersPerspective & | params, |
bool | flip | ||
) |
void glfMatrix::MakeTranslation | ( | GLfloat | x, |
GLfloat | y, | ||
GLfloat | z | ||
) |
Definition at line 99 of file glfMatrix.cpp.
Referenced by MakeLookAt().
void glfMatrix::MakeViewMatrix | ( | const ProjectionParametersBase & | params | ) |
Definition at line 271 of file glfMatrix.cpp.
References BIAS::ProjectionParametersBase::GetC(), BIAS::ProjectionParametersBase::GetR(), Make(), and BIAS::Matrix3x3< T >::Transpose().
void glfMatrix::MakeViewMatrixNew | ( | const ProjectionParametersBase & | params | ) |
Definition at line 287 of file glfMatrix.cpp.
References BIAS::CoordinateTransform3D::GetGlobalToLocalTransform(), BIAS::ProjectionParametersBase::GetPose(), and Make().
|
static |
Definition at line 524 of file glfMatrix.cpp.
Referenced by Multiply().
void glfMatrix::Multiply | ( | const glfMatrix & | a | ) |
Definition at line 499 of file glfMatrix.cpp.
void glfMatrix::Multiply | ( | BIAS::Vector4< double > | vIn, |
BIAS::Vector4< double > & | vOut | ||
) |
Definition at line 529 of file glfMatrix.cpp.
References Matrix2DIndexToRep().
Definition at line 509 of file glfMatrix.cpp.
void glfMatrix::operator*= | ( | const glfMatrix & | a | ) |
Definition at line 504 of file glfMatrix.cpp.
Transforms a point by the matrix.
Definition at line 480 of file glfMatrix.cpp.
Referenced by TransformPoint().
Definition at line 492 of file glfMatrix.cpp.
References TransformPoint().
|
friend |
Definition at line 160 of file glfMatrix.hh.
|
static |
The identity matrix.
Definition at line 158 of file glfMatrix.hh.
Referenced by BIAS::glfBatch::glfBatch(), and MakeIdentity().