ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

m_matrix.c File Reference
#include "main/glheader.h"
#include "main/imports.h"
#include "main/macros.h"
#include "m_matrix.h"

Go to the source code of this file.

Defines

#define MAT_FLAG_IDENTITY   0
#define MAT_FLAG_GENERAL   0x1
#define MAT_FLAG_ROTATION   0x2
#define MAT_FLAG_TRANSLATION   0x4
#define MAT_FLAG_UNIFORM_SCALE   0x8
#define MAT_FLAG_GENERAL_SCALE   0x10
#define MAT_FLAG_GENERAL_3D   0x20
#define MAT_FLAG_PERSPECTIVE   0x40
#define MAT_FLAG_SINGULAR   0x80
#define MAT_DIRTY_TYPE   0x100
#define MAT_DIRTY_FLAGS   0x200
#define MAT_DIRTY_INVERSE   0x400
#define MAT_FLAGS_ANGLE_PRESERVING
#define MAT_FLAGS_GEOMETRY
#define MAT_FLAGS_LENGTH_PRESERVING
#define MAT_FLAGS_3D
#define MAT_DIRTY
#define TEST_MAT_FLAGS(mat, a)   ((MAT_FLAGS_GEOMETRY & (~(a)) & ((mat)->flags) ) == 0)
#define MAT(m, r, c)   (m)[(c)*4+(r)]
#define M(row, col)   m[col*4+row]
#define M(row, col)   m[col*4+row]
#define M(row, col)   m[col*4+row]

Functions

GLboolean _math_matrix_is_length_preserving (const GLmatrix *m)
GLboolean _math_matrix_has_rotation (const GLmatrix *m)
GLboolean _math_matrix_is_general_scale (const GLmatrix *m)
GLboolean _math_matrix_is_dirty (const GLmatrix *m)
Matrix output
static void print_matrix_floats (const GLfloat m[16])
void _math_matrix_print (const GLmatrix *m)
Matrix generation
void _math_matrix_rotate (GLmatrix *mat, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
void _math_matrix_frustum (GLmatrix *mat, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval)
void _math_matrix_ortho (GLmatrix *mat, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval)
void _math_matrix_scale (GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z)
void _math_matrix_translate (GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z)
void _math_matrix_viewport (GLmatrix *m, GLint x, GLint y, GLint width, GLint height, GLfloat zNear, GLfloat zFar, GLfloat depthMax)
void _math_matrix_set_identity (GLmatrix *mat)
Matrix setup
void _math_matrix_copy (GLmatrix *to, const GLmatrix *from)
void _math_matrix_loadf (GLmatrix *mat, const GLfloat *m)
void _math_matrix_ctr (GLmatrix *m)
void _math_matrix_dtr (GLmatrix *m)
void _math_matrix_alloc_inv (GLmatrix *m)
Matrix transpose
void _math_transposef (GLfloat to[16], const GLfloat from[16])
void _math_transposed (GLdouble to[16], const GLdouble from[16])
void _math_transposefd (GLfloat to[16], const GLdouble from[16])

Variables

static const chartypes []
static GLfloat Identity [16]

Matrix multiplication

#define A(row, col)   a[(col<<2)+row]
#define B(row, col)   b[(col<<2)+row]
#define P(row, col)   product[(col<<2)+row]
static void matmul4 (GLfloat *product, const GLfloat *a, const GLfloat *b)
static void matmul34 (GLfloat *product, const GLfloat *a, const GLfloat *b)
static void matrix_multf (GLmatrix *mat, const GLfloat *m, GLuint flags)
void _math_matrix_mul_matrix (GLmatrix *dest, const GLmatrix *a, const GLmatrix *b)
void _math_matrix_mul_floats (GLmatrix *dest, const GLfloat *m)

Matrix inversion

#define SWAP_ROWS(a, b)   { GLfloat *_tmp = a; (a)=(b); (b)=_tmp; }
typedef GLboolean(* inv_mat_func )(GLmatrix *mat)
static inv_mat_func inv_mat_tab [7]
static GLboolean invert_matrix_general (GLmatrix *mat)
static GLboolean invert_matrix_3d_general (GLmatrix *mat)
static GLboolean invert_matrix_3d (GLmatrix *mat)
static GLboolean invert_matrix_identity (GLmatrix *mat)
static GLboolean invert_matrix_3d_no_rot (GLmatrix *mat)
static GLboolean invert_matrix_2d_no_rot (GLmatrix *mat)
static GLboolean matrix_invert (GLmatrix *mat)

Matrix analysis

#define ZERO(x)   (1<<x)
#define ONE(x)   (1<<(x+16))
#define MASK_NO_TRX   (ZERO(12) | ZERO(13) | ZERO(14))
#define MASK_NO_2D_SCALE   ( ONE(0) | ONE(5))
#define MASK_IDENTITY
#define MASK_2D_NO_ROT
#define MASK_2D
#define MASK_3D_NO_ROT
#define MASK_3D
#define MASK_PERSPECTIVE
#define SQ(x)   ((x)*(x))
static void analyse_from_scratch (GLmatrix *mat)
static void analyse_from_flags (GLmatrix *mat)
void _math_matrix_analyse (GLmatrix *mat)

Detailed Description

Matrix operations.

Note:
  1. 4x4 transformation matrices are stored in memory in column major order.
  2. Points/vertices are to be thought of as column vectors.
  3. Transformation of a point p by a matrix M is: p' = M * p

Definition in file m_matrix.c.


Generated on Mon May 28 2012 04:58:57 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.