Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

matrix.h File Reference

4x4 Matrix More...

#include <lescegra/util/vertex.h>

Include dependency graph for matrix.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define LSG_MATRIX_H   1

Typedefs

typedef float Matrix [16]
 4x4 matrix


Functions

void matrix_load_identity (Matrix m)
void matrix_load_translate (Matrix m, float x, float y, float z)
void matrix_load_translatev (Matrix m, Vertex v)
void matrix_load_scale (Matrix m, float x, float y, float z)
void matrix_load_scalev (Matrix m, Vertex v)
void matrix_load_rotate (Matrix m, float x, float y, float z)
void matrix_load_rotatev (Matrix m, Vertex v)
void matrix_load_ortho (Matrix m, float x1, float x2, float y1, float y2, float z1, float z2)
void matrix_load_frustum (Matrix m, float x1, float x2, float y1, float y2, float z1, float z2)
void matrix_load_perspective (Matrix m, float fovy, float aspect, float near, float far)
void matrix_load_lookat (Matrix m, Vertex from, Vertex to, Vertex up)
void matrix_load_pick (Matrix m, float x, float y, float w, float h, float vp_x, float vp_y, float vp_w, float vp_h)
void matrix_copy (Matrix dst, const Matrix src)
void matrix_mult (Matrix dst, const Matrix src)
void matrix_premult (Matrix dst, const Matrix src)
void matrix_transpose (Matrix m)
void matrix_invert (Matrix m)
void matrix_apply (const Matrix m, Vertex v)
void matrix_preapply (const Matrix m, Vertex v)

Variables

const Matrix matrix_identity


Detailed Description

4x4 Matrix


Typedef Documentation

typedef float Matrix[16]
 

4x4 matrix

A 4x4 matrix


Function Documentation

void matrix_load_identity Matrix  m  ) 
 

Reset a matrix to the identity.

Parameters:
m The matrix to reset

void matrix_load_translate Matrix  m,
float  x,
float  y,
float  z
 

Create a translation matrix.

Parameters:
m The destination matrix
x The first translation component
y The second translation component
z The third translation component

void matrix_load_translatev Matrix  m,
Vertex  v
 

Create a translation matrix from a vertex.

Parameters:
m The destination matrix
v The translation vertex

void matrix_load_scale Matrix  m,
float  x,
float  y,
float  z
 

Create a scaling matrix.

Parameters:
m The destination matrix
x The first scaling component
y The second scaling component
z The third scaling component

void matrix_load_scalev Matrix  m,
Vertex  v
 

Create a scaling matrix from a scaling vertex.

Parameters:
m The destination matrix
v The scaling vertex

void matrix_load_rotate Matrix  m,
float  x,
float  y,
float  z
 

Create a rotation matrix.

void matrix_load_ortho Matrix  m,
float  x1,
float  x2,
float  y1,
float  y2,
float  z1,
float  z2
 

Create an orthogonal projection matrix.

void matrix_load_frustum Matrix  m,
float  x1,
float  x2,
float  y1,
float  y2,
float  z1,
float  z2
 

Create a frustum projection matrix.

void matrix_load_perspective Matrix  m,
float  fovy,
float  aspect,
float  near,
float  far
 

Create a perspective projection matrix.

void matrix_load_lookat Matrix  m,
Vertex  from,
Vertex  to,
Vertex  up
 

Create a lookat matrix.

void matrix_load_pick Matrix  m,
float  x,
float  y,
float  w,
float  h,
float  vp_x,
float  vp_y,
float  vp_w,
float  vp_h
 

Create a pick matrix.

void matrix_copy Matrix  dst,
const Matrix  src
 

Copy a matrix into another.

Parameters:
dst The destination matrix
src The source matrix

void matrix_mult Matrix  dst,
const Matrix  src
 

Post-Multiply a matrix with another.

Parameters:
dst The destination matrix
src The source matrix

void matrix_premult Matrix  dst,
const Matrix  src
 

Pre-Multiply a matrix with another.

Parameters:
dst The destination matrix
src The source matrix

void matrix_transpose Matrix  m  ) 
 

Transpose a matrix.

Parameters:
m The matrix to transpose

void matrix_invert Matrix  m  ) 
 

Invert a matrix.

Parameters:
m The matrix to invert

void matrix_apply const Matrix  m,
Vertex  v
 

Post-Multiply a matrix and a vertex. v = M * v

Parameters:
m The transformation matrix
v The vertex to be transformed

void matrix_preapply const Matrix  m,
Vertex  v
 

Pre-Multiply a matrix and a vertex. v = v * M

Parameters:
m The transformation matrix
v The vertex to be transformed


Variable Documentation

const Matrix matrix_identity
 

The identity matrix


(c) 2003, by Enno Cramer
generated on 13 Jul 2003
lescegra - doxygen