33 #define M_PI 3.14159265358979323846f
44 return M_PI * degrees / 180.0f;
82 crossProduct.x = (vector1.y * vector2.z) - (vector1.z * vector2.y);
83 crossProduct.y = (vector1.z * vector2.x) - (vector1.x * vector2.z);
84 crossProduct.z = (vector1.x * vector2.y) - (vector1.y * vector2.x);
183 Matrix(
const float* array);
float & operator[](unsigned element)
Array operator for accessing the elements of the matrix.
Matrix operator*(Matrix right)
Multiply operator to post multiply a matrix by another.
static Matrix identityMatrix
The identity matrix.
static Vec3f cross(const Vec3f &vector1, const Vec3f &vector2)
Calculate cross product between two 3D floating point vectors.
Matrix(void)
Default constructor.
static const float identityArray[]
A 4x4 identity Matrix;.
static Matrix matrixPerspective(float FOV, float ratio, float zNear, float zFar)
Create and return a perspective projection matrix.
float * getAsArray(void)
Get the matrix elements as a column major order array.
A 3D floating point vector.
GLfloat GLfloat GLfloat w
static Matrix matrixCameraLookAt(Vec3f eye, Vec3f center, Vec3f up)
Create and return a camera matrix.
#define M_PI
PI value approximation.
void normalize(void)
Normalize 4D floating point vector.
float degreesToRadians(float degrees)
Convert an angle in degrees to radians.
GLint GLint GLint GLint GLint x
GLenum GLuint GLenum GLsizei length
static Matrix multiply(Matrix *left, Matrix *right)
Multiply 2 matrices to return a third.
Matrix & operator=(const Matrix &another)
Overloading assingment operater to do deep copy of the Matrix elements.
float elements[16]
A 16 element floating point array used to represent a 4x4 matrix.
void normalize(void)
Normalize 3D floating point vector.