Namespaces | Defines

include/VR3Math.h File Reference

Math functions utility header file. More...

Go to the source code of this file.

Namespaces

namespace  VR3Math
 

Math functions namespace.


Defines

#define VR3MATH_MAX2(A, B)   ((A)>(B))?(A):(B)
 Utility macro extracting the maximum between 2 values.
#define VR3MATH_MIN2(A, B)   ((A)<(B))?(A):(B)
 Utility macro extracting the minimum between 2 values.
#define VR3MATH_MAX3(A, B, C)   ((A)>(B))?((A)>(C)?(A):(C)):((B)>(C)?(B):(C))
 Utility macro extracting the maximum among 3 values.
#define VR3MATH_MIN3(A, B, C)   ((A)<(B))?((A)<(C)?(A):(C)):((B)<(C)?(B):(C))
 Utility macro extracting the minimnum among 3 values.
#define VR3MATH_PI   3.14159265f
 PI GLfloat value.

Functions

3-Components Vectors
GLvoid VR3Math::Cross3 (GLfloat result[3], const GLfloat vector0[3], const GLfloat vector1[3])
 Computes the cross product of two 3-components vectors.
GLfloat VR3Math::Dot3 (const GLfloat vector0[3], const GLfloat vector1[3])
 Computes the dot product of two 3-components vectors.
GLfloat VR3Math::EuclideanNorm3 (const GLfloat vector[3])
 Computes the euclidean norm of a 3-components vector.
GLfloat VR3Math::EuclideanNorm3 (const GLfloat x, const GLfloat y, const GLfloat z)
 Computes the euclidean norm of a 3-components vector.
GLvoid VR3Math::Normalize3 (GLfloat vector[3])
 Normalizes a 3-components vector.
4x4 Matrices
GLfloat VR3Math::Determinant4x4 (const GLfloat m[16])
 Computes the determinant of a 4x4 matrix.
GLboolean VR3Math::InvertMatrix4x4 (GLfloat result[16], const GLfloat m[16])
 Inverts a 4x4 matrix.
GLvoid VR3Math::MultMatrix4x4 (GLfloat matrix[16], const GLfloat matrix0[16], const GLfloat matrix1[16])
 Multiplies two 4x4 matrices.
GLvoid VR3Math::LoadIdentity4x4 (GLfloat matrix[16])
 Loads an identity 4x4 matrix.
GLvoid VR3Math::Rotate4x4 (GLfloat matrix[16], GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
 Combines a rototranslation matrix with a new rotation obtained using and angle and an axis.
GLvoid VR3Math::RotateAngles4x4 (GLfloat matrix[16], GLfloat ax, GLfloat ay, GLfloat az)
 Combines a rototranslation matrix with a new rotation obtained using three angles.
GLvoid VR3Math::Translate4x4 (GLfloat matrix[16], GLfloat x, GLfloat y, GLfloat z)
 Combines a rototranslation matrix with a new translation matrix.
GLvoid VR3Math::Scale4x4 (GLfloat matrix[16], GLfloat x, GLfloat y, GLfloat z)
 Combines a rototranslation matrix with a new scale matrix.
GLvoid VR3Math::LookAt4x4 (GLfloat result[16], GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, GLfloat centerX, GLfloat centerY, GLfloat centerZ, GLfloat upX, GLfloat upY, GLfloat upZ)
 Initializes a rototranslation matrix to look at a specified point.
GLvoid VR3Math::Ortho4x4 (GLfloat result[16], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal)
 Sets up an orthogonal projection matrix.
GLvoid VR3Math::Perspective4x4 (GLfloat result[16], GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar)
 Sets up a perspective projection matrix.
GLvoid VR3Math::Frustum4x4 (GLfloat result[16], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal)
 Prepare perspective matrix that produces a perspective projection.
Matrices and vectors
GLvoid VR3Math::MultMat4x4Vector3 (GLfloat result[3], const GLfloat matrix[16], const GLfloat vector[3])
 Multiplies a transformation matrix to a 3-components vector.
GLvoid VR3Math::MultMat4x4Vector4 (GLfloat result[4], const GLfloat matrix[16], const GLfloat vector[4])
 Multiplies a transformation matrix to a 4-components vector.
void VR3Math::TriangleNormal (const GLfloat *vertex1, const GLfloat *vertex2, const GLfloat *vertex3, GLfloat *normal)
 Computes the normal vector for a given triangle.

Detailed Description

Math functions utility header file.

Author:
Daniele Giannetti
Version:
1.0
Date:
August 2010

This header file declares some utility functions to work with vectors and matrices.

Definition in file VR3Math.h.


Define Documentation

#define VR3MATH_MAX2 (   A,
 
)    ((A)>(B))?(A):(B)

Utility macro extracting the maximum between 2 values.

Definition at line 25 of file VR3Math.h.

#define VR3MATH_MAX3 (   A,
  B,
 
)    ((A)>(B))?((A)>(C)?(A):(C)):((B)>(C)?(B):(C))

Utility macro extracting the maximum among 3 values.

Definition at line 29 of file VR3Math.h.

#define VR3MATH_MIN2 (   A,
 
)    ((A)<(B))?(A):(B)

Utility macro extracting the minimum between 2 values.

Definition at line 27 of file VR3Math.h.

#define VR3MATH_MIN3 (   A,
  B,
 
)    ((A)<(B))?((A)<(C)?(A):(C)):((B)<(C)?(B):(C))

Utility macro extracting the minimnum among 3 values.

Definition at line 31 of file VR3Math.h.

#define VR3MATH_PI   3.14159265f

PI GLfloat value.

Definition at line 34 of file VR3Math.h.

 All Classes Namespaces Files Functions Variables Typedefs Friends Defines