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

mat3 Struct Reference

List of all members.

Detailed Description

A 3x3 matrix.


Public Member Functions

void set (vec3 a, vec3 b, vec3 c)
 Set this matrix.

void set (float aa, float ab, float ac, float ba, float bb, float bc, float ca, float cb, float cc)
 Set this matrix.

mat3 scale (float x, float y)
 Multiply by a scaling matrix.

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

mat3 scale (vec3 amount)
 Multiply by a scaling matrix.

mat3 translate (float x, float y)
 Multiply by a translation matrix.

mat3 translate (vec2 amount)
 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.

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

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

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

vec3 row (int row)
 Return a row on the matrix.

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

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

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

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

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

mat3 swizzle (int a, int b, int c)
 Swizzle.

vec2 rotate (vec2 v)
 Rotate the vector, ignoring the z component.

mat3 transpose ()
 Get the transpose matrix.

mat3 mul (mat3 mb)
 Multiply matrices.

vec2 mul (vec2 v)
 Multiply matrix by one-extended vector.

vec3 mul (vec3 v)
 Multiply matrix by vector.

mat3 mulass (mat3 mb)
 Multiply and assign matrix.

bit eq (mat3 b)
 Test for equality.

void print ()
 Print the matrix.

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


Static Public Member Functions

mat3 fromTo (vec3 from, vec3 to)
 Create a rotation matrix that rotates a vector from one point to another point (stolen from OPCODE).

mat3 fromNormal (vec3 normal)
 Create a rotation matrix from a normal.

mat3 create (vec3 a, vec3 b, vec3 c)
 Create a matrix using normal order.

mat3 create (float aa, float ab, float ac, float ba, float bb, float bc, float ca, float cb, float cc)
 Create a matrix using normal order.

mat3 identity ()
 Get the identity matrix.

mat3 rotationDeg (float angle, float x, float y, float z)
 Get a rotation matrix.

mat3 rotationDeg (float angle, vec3 v)
 Get a rotation matrix.

mat3 rotationRad (float angle, float x, float y, float z)
 Get a rotation matrix.

mat3 rotationRad (float angle, vec3 v)
 Get a rotation matrix.

mat3 scaling (float x, float y)
 Get a scaling matrix.

mat3 scaling (vec2 amount)
 Get a scaling matrix.

mat3 scaling (vec3 amount)
 Get a scaling matrix.

mat3 translation (float x, float y)
 Get a translation matrix.

mat3 translation (vec2 v)
 Get a translation matrix.


Member Function Documentation

mat3 mat3.fromNormal vec3  normal  )  [static]
 

Create a rotation matrix from a normal.

The normal need not be normalised.

mat3 mat3.rotationDeg float  angle,
vec3  v
[static]
 

Get a rotation matrix.

angle is in degrees.

mat3 mat3.rotationDeg float  angle,
float  x,
float  y,
float  z
[static]
 

Get a rotation matrix.

angle is in degrees.

mat3 mat3.rotationRad float  angle,
vec3  v
[static]
 

Get a rotation matrix.

angle is in radians.

mat3 mat3.rotationRad float  angle,
float  x,
float  y,
float  z
[static]
 

Get a rotation matrix.

angle is in radians.


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