Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

mat2 Struct Reference

List of all members.

Detailed Description

A 2x2 matrix.


Public Member Functions

void set (vec2 a, vec2 b)
 Set this matrix.

void set (float aa, float ab, float ba, float bb)
 Set this matrix.

mat2 scale (float x)
 Multiply by a scaling matrix.

mat2 scale (vec2 amount)
 Multiply by a scaling matrix.

mat2 translate (float x)
 Multiply by a translation matrix.

bit isIdentity ()
 Return whether this is an identity matrix.

void set (int col, int row, float value)
 Set a cell on the matrix.

float get (int col, int row)
 Get a cell on the matrix.

void row (int row, float a, float b)
 Set a row on the matrix.

void row (int row, vec2 vec)
 Set a row on the matrix.

vec2 col (int col)
 Get a column on the matrix.

float col1 (int col)
 Get a column on the matrix as a scalar.

void col (int col, float a, float b)
 Set a column on the matrix.

void col (int col, vec2 vec)
 Set a column on the matrix.

vec2 diag ()
 Get the diagonal (which encodes the simple scale).

float[] array ()
 Get the full 4-cell array.

mat2 swizzle (int a, int b)
 Swizzle.

float rotate (float v)
 Rotate the scalar, ignoring the y component.

mat2 transpose ()
 Get the transpose matrix.

mat2 mul (mat2 mb)
 Multiply matrices.

float mul (float v)
 Multiply matrix by one-extended scalar.

vec2 mul (vec2 v)
 Multiply matrix by vector.

bit eq (mat2 b)
 Test for equality.

void print ()
 Print the matrix.

char[] toString ()
 Convert to a four-line string.


Static Public Member Functions

mat2 create (vec2 a, vec2 b)
 Create a matrix using normal order.

mat2 create (float aa, float ab, float ba, float bb)
 Create a matrix using normal order.

mat2 identity ()
 Get the identity matrix.

mat2 scaling (float x)
 Get a scaling matrix.

mat2 scaling (vec2 amount)
 Get a scaling matrix.

mat2 translation (float amount)
 Get a translation matrix.


Public Attributes

vec2 cols [2]
 The matrix data, in OpenGL's silly order (transposed from sensible).


The documentation for this struct was generated from the following file:
Generated on Thu Sep 4 13:12:52 2003 for dig by doxygen 1.3.2