VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties
VisiMath.Matrix4 Struct Reference

Matrix 4x4 used for homogenous transformations. More...

List of all members.

## Public Member Functions
| Matrix4 (ref Matrix4 mat)
| Matrix4 (float val)
| Initializes matrix with all values set to val.
| Matrix4 (float[] data)
| Copies content of the float[] to matrix.
| Matrix4 (float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
| Initialize matrix with all specified values.
| Matrix4 (Matrix3 rotation)
| Creates homogenous Matrix4 from rotation matrix with zero translation.
| Matrix4 (Matrix3 rotation, Vector3 translation)
| Creates homogenous transformation matrix from rotation/scale matrix and translation vector.
| Matrix4 (Quaternion rot, Vector3 translation)
| Creates new homogenous transformation matrix from rotation quaternion and translation vector.
| Matrix4 (Quaternion rot)
| Creates new homogenous transformation matrix from rotation quaternion.
| Matrix4 (Vector4 row0, Vector4 row1, Vector4 row2, Vector4 row3)
| Construct matrix from for rows of vector4.
void | Assign (float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
| Assigns new values to the matrix.
void | SetToIdentity ()
| Sets matrix to identity.
void | Transpose ()
| Transposes matrix.
void | Invert ()
| Inverts matrix.
void | Add (ref Matrix4 other)
| Adds another matrix to this one.
void | Substract (ref Matrix4 other)
| Substracts another matrix from this one.
void | Multiply (float scale)
| Scalar multiplication.
void | MultiplyBy (ref Matrix4 other)
| Multiplies this matrix by another (this = this*other)
void | MultiplyBy (Matrix4 other)
| Multiplies this matrix by another (this = this*other)
Matrix4 | Multiply (ref Matrix4 other)
| Multiplies this matrix by another and returns this*other)
Vector3 | Multiply (Vector3 vec)
| Multiplies vector by the matrix and returns result.
Vector3 | MultiplyFast (Vector3 vec)
| Fast multiplication (ignoring 4th row) for regular transformations.
Vector3 | Multiply (ref Vector3 vec)
| Multiplies vector by the matrix and returns result.
Vector3 | MultiplyFast (ref Vector3 vec)
| Fast multiplication (ignoring 4th row) for regular transformations.
Vector4 | Multiply (ref Vector4 vec)
| Multiplies vector by the matrix and returns result.
void | Transform (ref Vector3 vec)
| Transforms specified vector by the matrix.
void | TransformFast (ref Vector3 vec)
| Faster transformation of the vector for matrices with fourth row 0 0 0 1 (normal transformation matrices)
void | TransformInverted (ref Vector3 vec)
| Inverse transformation of the vector. Works ONLY for matrices with rotation and translation.
void | Transform (Vector3[] array)
| Transforms all vectors in array by the matrix.
void | TransformFast (Vector3[] array)
| Transforms all vectors in array by the matrix, ignoring the 4th row for normal transformations without perspective change.
void | Transform (IVertex[] array)
| Transforms all positions and normals in array of vertex by the matrix.
void | TransformFast (IVertex[] array)
| Transforms all positions and normals in array of vertex by the matrix, fast version not using 4 th row.
void | Transform (IVertexArray array)
| Transforms all positions and normals in array of vertex by the matrix.
void | TransformFast (IVertexArray array)
| Transforms all positions and normals in array of vertex by the matrix.
void | TransformNormal (ref Vector3 vec)
| Transforms Normal, uses slow invert.transpose.transform of rotation matrix. For transformations with uniform scaling use TransformNormalFast or store transformation matrix by yourself.
void | TransformNormalFast (ref Vector3 vec)
| rotates normal - note, works correctly only for transformations with uniform scaling! Use TransformNormal for (slow) correct computation
void | Transform (ref Vector4 vec)
| Transforms specified vector by the matrix.
void | Deconstruct (out float uniformscale, out Vector3 scale, out Quaternion q, out Vector3 trans)
| Deconstructs homogenous transformation matrix to scale, rotation and translation. NOTE: if scale is uniform, uniformscale will be set to it, otherwise it will be set to zero.
void | Deconstruct (out float uniformscale, out Vector3 scale, out Vector3 rpy, out Vector3 trans)
| Deconstructs homogenous transformation matrix to scale, rotation and translation. NOTE: if scale is uniform, uniformscale will be set to it, otherwise it will be set to zero.
float | GetUniformScale ()
| Tries to extract uniform scale from the matrix.
void | GetScale (out float uniform, out Vector3 scale)
| Tries to extract scale from the matrix. If scale is not uniform, uniform parameter will be zero.
Matrix4 | ConvertToCamera ()
| Constructs camera matrix from this matrix (inverted and rotated so camera faces X axis, not Z as by default)
void | ConvertToCamera (ref Matrix4 other)
| Constructs camera matrix from this matrix (inverted and rotated so camera faces X axis, not Z as by default)
override int | GetHashCode ()
override string | ToString ()
override bool | Equals (object obj)
bool | Equals (Matrix4 other)
## Static Public Member Functions
static Matrix4 | CreateScale (float scale)
| Creates uniform scale matrix.
static Matrix4 | CreateScale (ref Vector3 scale)
| Creates non-uniform scale transformation.
static Matrix4 | CreateScale (float x, float y, float z)
| Creates non-uniform scale transformation.
static Matrix4 | CreateRotationNormal (Vector3 normal, Vector3 newnormal)
| Creates rotational matrix based on original and new normal vector)
static Matrix4 | CreateRotationAxisAngle (Vector3 axis, float angle)
| Creates rotation transformation from axis and angle.
static Matrix4 | CreateRotationX (float angle)
| Creates rotation transformation around the x axis.
static Matrix4 | CreateRotationY (float angle)
| Creates rotation transformation around the y axis.
static Matrix4 | CreateRotationZ (float angle)
| Creates rotation transformation around the z axis.
static Matrix4 | CreateRotationRPY (ref Vector3 rpy)
| Creates rotation transformation from the roll pitch yaw angles.
static Matrix4 | CreateRotationRPY (float roll, float pitch, float yaw)
| Creates rotation transformation from the roll pitch yaw angles.
static Matrix4 | CreateRotation (ref Quaternion q)
| Creates rotation from the quaternion.
static Matrix4 | CreateTranslation (ref Vector3 vec)
| Creates translation matrix.
static Matrix4 | CreateTranslation (Vector3 vec)
| Creates translation matrix.
static Matrix4 | CreateTransformation (ref Matrix3 rot, ref Vector3 trans)
| Creates transformation from the rotation matrix3x3 and translation vector.
static Matrix4 | CreateTransformation (ref Quaternion q, ref Vector3 trans)
| Creates transformation from the rotation quaternion and translation vector.
static Matrix4 | CreateTransformation (ref Vector3 rpy, ref Vector3 trans)
| Creates transformation from the rotation in RPY and translation vector.
static Matrix4 | CreateTransformation (ref Vector3 scale, ref Vector3 rpy, ref Vector3 trans)
| Creates transformation from the scale vector, rotation in RPY and translation vector.
static Matrix4 | CreateTransformation (ref Vector3 scale, ref Quaternion q, ref Vector3 trans)
| Creates complete transformation from scale vector, rotation quaternion and translation vector.
static Matrix4 | CreateOrtographic (float left, float right, float top, float bottom, float zNear, float zFar)
| Creates ortographic projection matrix.
static void | CreateOrtographic (float left, float right, float top, float bottom, float zNear, float zFar, ref Matrix4 mat)
| Creates ortographic projection matrix.
static Matrix4 | CreateOrtographic (float width, float height, float zNear, float zFar)
| Creates ortographic projection matrix.
static void | CreateOrtographic (float width, float height, float zNear, float zFar, ref Matrix4 mat)
| Creates ortographic projection matrix.
static Matrix4 | CreatePerspective (float left, float right, float top, float bottom, float zNear, float zFar)
| Creates perspective projection matrix.
static void | CreatePerspective (float left, float right, float top, float bottom, float zNear, float zFar, ref Matrix4 mat)
| Creates perspective projection matrix.
static Matrix4 | CreatePerspective (float fov, float aspect, float zNear, float zFar)
| Creates perspective projection matrix.
static void | CreatePerspective (float fov, float aspect, float zNear, float zFar, ref Matrix4 mat)
| Creates perspective projection matrix.
static Matrix4 | LookAt (ref Vector3 eye, ref Vector3 target, ref Vector3 up)
| Creates camera transformation.
static void | LookAt (ref Vector3 eye, ref Vector3 target, ref Vector3 up, ref Matrix4 mat)
| Creates camera transformation.
static void | OrientedCamera (ref Vector3 eye, ref Vector3 rpy, ref Matrix4 mat)
| Constructs Camera matrix (inverted normal transformation and rotated so camera faces X axis, not Z as by default)
static Matrix4 | OrientedCamera (ref Vector3 eye, ref Vector3 rpy)
| Constructs Camera matrix (inverted normal transformation and rotated so camera faces X axis, not Z as by default)
static Matrix4 | Invert (ref Matrix4 matrix4)
| Calculates Inverse of the matrix.
static Matrix4 | Transpose (ref Matrix4 mat)
| Returns transposed matrix.
static Matrix4 | Multiply (ref Matrix4 left, ref Matrix4 right)
| Multiplies two matrices and returns result.
static Matrix4 | InverseMul (ref Matrix4 mat1, ref Matrix4 mat2)
| returns inverted multiplication (mat1.inverted*mat2)
static Matrix4 | operator* (Matrix4 left, Matrix4 right)
| Matrix multiplication.
static Matrix4 | operator* (Matrix4 left, float right)
| Scalar multiplication.
static Matrix4 | operator* (float left, Matrix4 right)
| Scalar multiplication.
static Matrix4 | operator- (Matrix4 left, Matrix4 right)
| Substraction of two matrices.
static Matrix4 | operator+ (Matrix4 left, Matrix4 right)
| Addition of two matrices.
static Vector4 | operator* (Matrix4 left, Vector4 right)
| Multiplication of vector by matrix.
static Vector3 | operator* (Matrix4 left, Vector3 right)
| Multiplication of vector by matrix.
static bool | operator== (Matrix4 left, Matrix4 right)
| Compares two instances.
static bool | operator!= (Matrix4 left, Matrix4 right)
| Compares two instances.
## Public Attributes
float | m00
float | m10
float | m20
float | m30
float | m01
float | m11
float | m21
float | m31
float | m02
float | m12
float | m22
float | m32
float | m03
float | m13
float | m23
float | m33
## Static Public Attributes
static Matrix4 | Identitity = new Matrix4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
| Identity matrix.
static Matrix4 | RotationX90
| Static rotation 90 degrees around the X axis.
static Matrix4 | RotationX180
static Matrix4 | RotationX270
static Matrix4 | RotationY90
| Static rotation 90 degrees around the Y axis.
static Matrix4 | RotationZ90
| Static rotation 90 degrees around the Z axis.
static Matrix4 | RotationZ180
static Matrix4 | RotationZ270
static Matrix4 | camrot
## Properties
Vector4 | Row0`[get, set]`
Vector4 | Row1`[get, set]`
Vector4 | Row2`[get, set]`
Vector4 | Row3`[get, set]`
Vector4 | Column0`[get, set]`
Vector4 | Column1`[get, set]`
Vector4 | Column2`[get, set]`
Vector4 | Column3`[get, set]`
float | this[int index1, int index2]`[get, set]`
| Index acessor, maps internal fields to [index1, index2].
float | this[int index]`[get, set]`
| Index acessor, maps internal fields to one dimensional array.
Matrix3 | Rotation`[get, set]`
| Rotational matrix.
Vector3 | Translation`[get, set]`
| Translation vector.
float | Determinant`[get]`

## Detailed Description

Matrix 4x4 used for homogenous transformations.

## Constructor & Destructor Documentation

VisiMath.Matrix4.Matrix4 | ( | ref Matrix4 | mat | ) |

VisiMath.Matrix4.Matrix4 | ( | float | val | ) |

Initializes matrix with all values set to val.

Parameters:

  val | Initial value

VisiMath.Matrix4.Matrix4 | ( | float[] | data | ) |

Copies content of the float[] to matrix.

Parameters:

  data | Initial values

VisiMath.Matrix4.Matrix4 | ( | float | n00,
|  | float | n01,
|  | float | n02,
|  | float | n03,
|  | float | n10,
|  | float | n11,
|  | float | n12,
|  | float | n13,
|  | float | n20,
|  | float | n21,
|  | float | n22,
|  | float | n23,
|  | float | n30,
|  | float | n31,
|  | float | n32,
|  | float | n33
| ) |  |

Initialize matrix with all specified values.

VisiMath.Matrix4.Matrix4 | ( | Matrix3 | rotation | ) |

Creates homogenous Matrix4 from rotation matrix with zero translation.

Parameters:

  rotation | rotation matrix

VisiMath.Matrix4.Matrix4 | ( | Matrix3 | rotation,
|  | Vector3 | translation
| ) |  |

Creates homogenous transformation matrix from rotation/scale matrix and translation vector.

Parameters:

  rotation | Rotation matrix
  translation | Translation vector

VisiMath.Matrix4.Matrix4 | ( | Quaternion | rot,
|  | Vector3 | translation
| ) |  |

Creates new homogenous transformation matrix from rotation quaternion and translation vector.

Parameters:

  rot | Rotation
  translation | Translation

VisiMath.Matrix4.Matrix4 | ( | Quaternion | rot | ) |

Creates new homogenous transformation matrix from rotation quaternion.

Parameters:

  rot | Rotation

VisiMath.Matrix4.Matrix4 | ( | Vector4 | row0,
|  | Vector4 | row1,
|  | Vector4 | row2,
|  | Vector4 | row3
| ) |  |

Construct matrix from for rows of vector4.

## Member Function Documentation

void VisiMath.Matrix4.Add | ( | ref Matrix4 | other | ) |

Adds another matrix to this one.

Parameters:

  other | right operand

void VisiMath.Matrix4.Assign | ( | float | n00,
|  | float | n01,
|  | float | n02,
|  | float | n03,
|  | float | n10,
|  | float | n11,
|  | float | n12,
|  | float | n13,
|  | float | n20,
|  | float | n21,
|  | float | n22,
|  | float | n23,
|  | float | n30,
|  | float | n31,
|  | float | n32,
|  | float | n33
| ) |  |

Assigns new values to the matrix.

Matrix4 VisiMath.Matrix4.ConvertToCamera | ( |  | ) |

Constructs camera matrix from this matrix (inverted and rotated so camera faces X axis, not Z as by default)

Returns:
  Camera matrix

void VisiMath.Matrix4.ConvertToCamera | ( | ref Matrix4 | other | ) |

Constructs camera matrix from this matrix (inverted and rotated so camera faces X axis, not Z as by default)

static void VisiMath.Matrix4.CreateOrtographic | ( | float | left,
|  | float | right,
|  | float | top,
|  | float | bottom,
|  | float | zNear,
|  | float | zFar,
|  | ref Matrix4 | mat
| ) |  | `[static]`

Creates ortographic projection matrix.

Parameters:

  left | Left edge
  right | Right edge
  top | Top edge
  bottom | Bottom edge
  zNear | Near edge
  zFar | Far edge
  mat | Projection matrix

static Matrix4 VisiMath.Matrix4.CreateOrtographic | ( | float | width,
|  | float | height,
|  | float | zNear,
|  | float | zFar
| ) |  | `[static]`

Creates ortographic projection matrix.

Parameters:

  width | Width of volume
  height | Height of volume
  zNear | Near edge
  zFar | Far edge

Returns:
  Projection matrix

static void VisiMath.Matrix4.CreateOrtographic | ( | float | width,
|  | float | height,
|  | float | zNear,
|  | float | zFar,
|  | ref Matrix4 | mat
| ) |  | `[static]`

Creates ortographic projection matrix.

Parameters:

  width | Width of volume
  height | Height of volume
  zNear | Near edge
  zFar | Far edge
  mat | Projection matrix

static Matrix4 VisiMath.Matrix4.CreateOrtographic | ( | float | left,
|  | float | right,
|  | float | top,
|  | float | bottom,
|  | float | zNear,
|  | float | zFar
| ) |  | `[static]`

Creates ortographic projection matrix.

Parameters:

  left | Left edge
  right | Right edge
  top | Top edge
  bottom | Bottom edge
  zNear | Near edge
  zFar | Far edge

Returns:
  Projection matrix

static Matrix4 VisiMath.Matrix4.CreatePerspective | ( | float | left,
|  | float | right,
|  | float | top,
|  | float | bottom,
|  | float | zNear,
|  | float | zFar
| ) |  | `[static]`

Creates perspective projection matrix.

Parameters:

  left | Left edge
  right | Right edge
  bottom | Bottom edge
  top | Top edge
  zNear | Near edge
  zFar | Far edge

Returns:
  Projection matrix

Exceptions:

  System.ArgumentOutOfRangeException | Thrown if zNear or zFar less or equal to zero or if zNear is bigger then zFar

static void VisiMath.Matrix4.CreatePerspective | ( | float | left,
|  | float | right,
|  | float | top,
|  | float | bottom,
|  | float | zNear,
|  | float | zFar,
|  | ref Matrix4 | mat
| ) |  | `[static]`

Creates perspective projection matrix.

Parameters:

  left | Left edge
  right | Right edge
  bottom | Bottom edge
  top | Top edge
  zNear | Near edge
  zFar | Far edge
  mat | Projection matrix

Exceptions:

  System.ArgumentOutOfRangeException | Thrown if if zNear is bigger then zFar

static void VisiMath.Matrix4.CreatePerspective | ( | float | fov,
|  | float | aspect,
|  | float | zNear,
|  | float | zFar,
|  | ref Matrix4 | mat
| ) |  | `[static]`

Creates perspective projection matrix.

Parameters:

  fov | Field of vision in radians
  aspect | Aspect ratio of the screen
  zNear | Near edge
  zFar | Far edge
  mat | Matrix where the result will be saved

Exceptions:

  System.ArgumentOutOfRangeException | Thrown if zNear is bigger then zFar, or for wrong values of FOV or Aspect ration

static Matrix4 VisiMath.Matrix4.CreatePerspective | ( | float | fov,
|  | float | aspect,
|  | float | zNear,
|  | float | zFar
| ) |  | `[static]`

Creates perspective projection matrix.

Parameters:

  fov | Field of vision in radians
  aspect | Aspect ratio of the screen
  zNear | Near edge
  zFar | Far edge

Returns:
  Projection matrix

Exceptions:

  System.ArgumentOutOfRangeException | Thrown if zNear or zFar less or equal to zero or if zNear is bigger then zFar, or for wrong values of FOV or Aspect ration

static Matrix4 VisiMath.Matrix4.CreateRotation | ( | ref Quaternion | q | ) | `[static]`

Creates rotation from the quaternion.

Parameters:

  q | rotation quaternion

Returns:
  Rotation matrix

static Matrix4 VisiMath.Matrix4.CreateRotationAxisAngle | ( | Vector3 | axis,
|  | float | angle
| ) |  | `[static]`

Creates rotation transformation from axis and angle.

Parameters:

  axis | Rotation axis - must be normalized!
  angle | Angle in radians

Returns:
  Rotation transformation

static Matrix4 VisiMath.Matrix4.CreateRotationNormal | ( | Vector3 | normal,
|  | Vector3 | newnormal
| ) |  | `[static]`

Creates rotational matrix based on original and new normal vector)

Parameters:

  normal | Original normal
  newnormal | New normal

Returns:
  Rotational matrix

static Matrix4 VisiMath.Matrix4.CreateRotationRPY | ( | ref Vector3 | rpy | ) | `[static]`

Creates rotation transformation from the roll pitch yaw angles.

Parameters:

  rpy | Vector holding roll/pitch/yaw

Returns:
  Rotation matrix

static Matrix4 VisiMath.Matrix4.CreateRotationRPY | ( | float | roll,
|  | float | pitch,
|  | float | yaw
| ) |  | `[static]`

Creates rotation transformation from the roll pitch yaw angles.

Parameters:

  roll | roll angle
  pitch | pitch angle
  yaw | yaw angle

Returns:
  Rotation matrix

static Matrix4 VisiMath.Matrix4.CreateRotationX | ( | float | angle | ) | `[static]`

Creates rotation transformation around the x axis.

Parameters:

  angle | Angle in radians

Returns:
  Rotation transformation

static Matrix4 VisiMath.Matrix4.CreateRotationY | ( | float | angle | ) | `[static]`

Creates rotation transformation around the y axis.

Parameters:

  angle | Angle in radians

Returns:
  Rotation transformation

static Matrix4 VisiMath.Matrix4.CreateRotationZ | ( | float | angle | ) | `[static]`

Creates rotation transformation around the z axis.

Parameters:

  angle | Angle in radians

Returns:
  Rotation transformation

static Matrix4 VisiMath.Matrix4.CreateScale | ( | float | scale | ) | `[static]`

Creates uniform scale matrix.

Parameters:

  scale | scale value for all coordinates

Returns:
  new scale matrix

static Matrix4 VisiMath.Matrix4.CreateScale | ( | ref Vector3 | scale | ) | `[static]`

Creates non-uniform scale transformation.

Parameters:

  scale | vector with scale for x, y, z

Returns:
  new scale matrix

static Matrix4 VisiMath.Matrix4.CreateScale | ( | float | x,
|  | float | y,
|  | float | z
| ) |  | `[static]`

Creates non-uniform scale transformation.

Parameters:

  x | x scale
  y | y scale
  z | z scale

Returns:
  new scale matrix

static Matrix4 VisiMath.Matrix4.CreateTransformation | ( | ref Matrix3 | rot,
|  | ref Vector3 | trans
| ) |  | `[static]`

Creates transformation from the rotation matrix3x3 and translation vector.

Parameters:

  rot | Rotation matrix
  trans | Translation vector

Returns:
  Finished tranformation

static Matrix4 VisiMath.Matrix4.CreateTransformation | ( | ref Quaternion | q,
|  | ref Vector3 | trans
| ) |  | `[static]`

Creates transformation from the rotation quaternion and translation vector.

Parameters:

  q | rotation
  trans | translation

Returns:
  Finished transformation

static Matrix4 VisiMath.Matrix4.CreateTransformation | ( | ref Vector3 | rpy,
|  | ref Vector3 | trans
| ) |  | `[static]`

Creates transformation from the rotation in RPY and translation vector.

Parameters:

  rpy | Rotation in Roll Pitch Yaw format
  trans | Translation vector

Returns:
  Finished translation

static Matrix4 VisiMath.Matrix4.CreateTransformation | ( | ref Vector3 | scale,
|  | ref Vector3 | rpy,
|  | ref Vector3 | trans
| ) |  | `[static]`

Creates transformation from the scale vector, rotation in RPY and translation vector.

Parameters:

  scale | Scale vector
  rpy | Rotation in Roll Pitch Yaw format
  trans | Translation vector

Returns:
  Finished translation

static Matrix4 VisiMath.Matrix4.CreateTransformation | ( | ref Vector3 | scale,
|  | ref Quaternion | q,
|  | ref Vector3 | trans
| ) |  | `[static]`

Creates complete transformation from scale vector, rotation quaternion and translation vector.

Parameters:

  scale | Nonuniform scale
  q | Rotation
  trans | Translation

Returns:
  Finished transformation

static Matrix4 VisiMath.Matrix4.CreateTranslation | ( | ref Vector3 | vec | ) | `[static]`

Creates translation matrix.

Parameters:

  vec | translation vector

Returns:
  Translation matrix

static Matrix4 VisiMath.Matrix4.CreateTranslation | ( | Vector3 | vec | ) | `[static]`

Creates translation matrix.

Parameters:

  vec | translation vector

Returns:
  Translation matrix

void VisiMath.Matrix4.Deconstruct | ( | out float | uniformscale,
|  | out Vector3 | scale,
|  | out Quaternion | q,
|  | out Vector3 | trans
| ) |  |

Deconstructs homogenous transformation matrix to scale, rotation and translation. NOTE: if scale is uniform, uniformscale will be set to it, otherwise it will be set to zero.

Parameters:

  uniformscale | Will be set to uniform scale if used, othewise to zero
  scale | Will be set with scale vector
  q | will be set with rotation quaternion
  trans | Will be set with the translation vector

void VisiMath.Matrix4.Deconstruct | ( | out float | uniformscale,
|  | out Vector3 | scale,
|  | out Vector3 | rpy,
|  | out Vector3 | trans
| ) |  |

Deconstructs homogenous transformation matrix to scale, rotation and translation. NOTE: if scale is uniform, uniformscale will be set to it, otherwise it will be set to zero.

Parameters:

  uniformscale | Will be set to uniform scale if used, othewise to zero
  scale | Will be set with scale vector
  rpy | will be set with rotation in roll pitch yaw format
  trans | Will be set with the translation vector

bool VisiMath.Matrix4.Equals | ( | Matrix4 | other | ) |

override bool VisiMath.Matrix4.Equals | ( | object | obj | ) |

override int VisiMath.Matrix4.GetHashCode | ( |  | ) |

void VisiMath.Matrix4.GetScale | ( | out float | uniform,
|  | out Vector3 | scale
| ) |  |

Tries to extract scale from the matrix. If scale is not uniform, uniform parameter will be zero.

Parameters:

  uniform | Uniform scale if used otherwise zero
  scale | Scale vector

float VisiMath.Matrix4.GetUniformScale | ( |  | ) |

Tries to extract uniform scale from the matrix.

Returns:
  Uniform scale if present or zero

static Matrix4 VisiMath.Matrix4.InverseMul | ( | ref Matrix4 | mat1,
|  | ref Matrix4 | mat2
| ) |  | `[static]`

returns inverted multiplication (mat1.inverted*mat2)

Parameters:

  mat1 | left operand
  mat2 | right operand

Returns:
  (mat1.inverted*mat2)

static Matrix4 VisiMath.Matrix4.Invert | ( | ref Matrix4 | matrix4 | ) | `[static]`

Calculates Inverse of the matrix.

Parameters:

  matrix4 | Matrix to be inverted

Returns:
  Inverted matrix

Exceptions:

  System.ArgumentException | Thrown if matrix is singular

void VisiMath.Matrix4.Invert | ( |  | ) |

Inverts matrix.

static Matrix4 VisiMath.Matrix4.LookAt | ( | ref Vector3 | eye,
|  | ref Vector3 | target,
|  | ref Vector3 | up
| ) |  | `[static]`

Creates camera transformation.

Parameters:

  eye | Camera position
  target | Target position
  up | Up vector of the camera

Returns:
  Finished transformation

static void VisiMath.Matrix4.LookAt | ( | ref Vector3 | eye,
|  | ref Vector3 | target,
|  | ref Vector3 | up,
|  | ref Matrix4 | mat
| ) |  | `[static]`

Creates camera transformation.

Parameters:

  eye | Camera position
  target | Target position
  up | Up vector of the camera

Returns:
  Finished transformation

Matrix4 VisiMath.Matrix4.Multiply | ( | ref Matrix4 | other | ) |

Multiplies this matrix by another and returns this*other)

Parameters:

  other | right operand

static Matrix4 VisiMath.Matrix4.Multiply | ( | ref Matrix4 | left,
|  | ref Matrix4 | right
| ) |  | `[static]`

Multiplies two matrices and returns result.

Parameters:

  left | left operand
  right | right operand

Returns:
  left*right

Vector4 VisiMath.Matrix4.Multiply | ( | ref Vector4 | vec | ) |

Multiplies vector by the matrix and returns result.

Parameters:

  vec | Vector to be multiplied

Returns:
  Result vector

Vector3 VisiMath.Matrix4.Multiply | ( | Vector3 | vec | ) |

Multiplies vector by the matrix and returns result.

Parameters:

  vec | Vector to be multiplied

Returns:
  Result vector

Vector3 VisiMath.Matrix4.Multiply | ( | ref Vector3 | vec | ) |

Multiplies vector by the matrix and returns result.

Parameters:

  vec | Vector to be multiplied

Returns:
  Result vector

void VisiMath.Matrix4.Multiply | ( | float | scale | ) |

Scalar multiplication.

Parameters:

  scale | Scalar operand

void VisiMath.Matrix4.MultiplyBy | ( | ref Matrix4 | other | ) |

Multiplies this matrix by another (this = this*other)

Parameters:

  other | right operand

void VisiMath.Matrix4.MultiplyBy | ( | Matrix4 | other | ) |

Multiplies this matrix by another (this = this*other)

Parameters:

  other | right operand

Vector3 VisiMath.Matrix4.MultiplyFast | ( | Vector3 | vec | ) |

Fast multiplication (ignoring 4th row) for regular transformations.

Parameters:

  vec |

Returns:
  Transformed vector

Vector3 VisiMath.Matrix4.MultiplyFast | ( | ref Vector3 | vec | ) |

Fast multiplication (ignoring 4th row) for regular transformations.

Parameters:

  vec |

Returns:
  Transformed vector

static bool VisiMath.Matrix4.operator!= | ( | Matrix4 | left,
|  | Matrix4 | right
| ) |  | `[static]`

Compares two instances.

Parameters:

  left | first operand.
  right | second operand.

Returns:
  True if left != right, otherwise false.

static Matrix4 VisiMath.Matrix4.operator* | ( | Matrix4 | left,
|  | Matrix4 | right
| ) |  | `[static]`

Matrix multiplication.

Parameters:

  left | left operand
  right | right operand

Returns:
  New Matrix44 with result

static Vector4 VisiMath.Matrix4.operator* | ( | Matrix4 | left,
|  | Vector4 | right
| ) |  | `[static]`

Multiplication of vector by matrix.

Parameters:

  left | Matrix
  right | vector

Returns:
  Transformed vector

static Matrix4 VisiMath.Matrix4.operator* | ( | Matrix4 | left,
|  | float | right
| ) |  | `[static]`

Scalar multiplication.

Parameters:

  left | Matrix
  right | scalar

Returns:
  Matrix*scalar

static Matrix4 VisiMath.Matrix4.operator* | ( | float | left,
|  | Matrix4 | right
| ) |  | `[static]`

Scalar multiplication.

Parameters:

  left | scalar
  right | Matrix

Returns:
  Matrix*scalar

static Vector3 VisiMath.Matrix4.operator* | ( | Matrix4 | left,
|  | Vector3 | right
| ) |  | `[static]`

Multiplication of vector by matrix.

Parameters:

  left | Matrix
  right | vector

Returns:
  Transformed vector

static Matrix4 VisiMath.Matrix4.operator+ | ( | Matrix4 | left,
|  | Matrix4 | right
| ) |  | `[static]`

Addition of two matrices.

Parameters:

  left | left operand
  right | right operand

Returns:
  left + right

static Matrix4 VisiMath.Matrix4.operator- | ( | Matrix4 | left,
|  | Matrix4 | right
| ) |  | `[static]`

Substraction of two matrices.

Parameters:

  left | left operand
  right | right operand

Returns:
  left - right

static bool VisiMath.Matrix4.operator== | ( | Matrix4 | left,
|  | Matrix4 | right
| ) |  | `[static]`

Compares two instances.

Parameters:

  left | first operand.
  right | second operand.

Returns:
  True if left == right, otherwise false.

static Matrix4 VisiMath.Matrix4.OrientedCamera | ( | ref Vector3 | eye,
|  | ref Vector3 | rpy
| ) |  | `[static]`

Constructs Camera matrix (inverted normal transformation and rotated so camera faces X axis, not Z as by default)

Parameters:

  eye | Position of the camera
  rpy | Rotation of the camera

Returns:
  Camera matrix

static void VisiMath.Matrix4.OrientedCamera | ( | ref Vector3 | eye,
|  | ref Vector3 | rpy,
|  | ref Matrix4 | mat
| ) |  | `[static]`

Constructs Camera matrix (inverted normal transformation and rotated so camera faces X axis, not Z as by default)

Parameters:

  eye | Position of the camera
  rpy | Rotation of the camera
  mat | Matrix to save camera to

void VisiMath.Matrix4.SetToIdentity | ( |  | ) |

Sets matrix to identity.

void VisiMath.Matrix4.Substract | ( | ref Matrix4 | other | ) |

Substracts another matrix from this one.

Parameters:

  other | right operand

override string VisiMath.Matrix4.ToString | ( |  | ) |

void VisiMath.Matrix4.Transform | ( | ref Vector4 | vec | ) |

Transforms specified vector by the matrix.

Parameters:

  vec | Vector to be transformed

void VisiMath.Matrix4.Transform | ( | ref Vector3 | vec | ) |

Transforms specified vector by the matrix.

Parameters:

  vec | Vector to be transformed

void VisiMath.Matrix4.Transform | ( | IVertex[] | array | ) |

Transforms all positions and normals in array of vertex by the matrix.

Parameters:

  array | Array of vectors

void VisiMath.Matrix4.Transform | ( | Vector3[] | array | ) |

Transforms all vectors in array by the matrix.

Parameters:

  array | Array of vectors

void VisiMath.Matrix4.Transform | ( | IVertexArray | array | ) |

Transforms all positions and normals in array of vertex by the matrix.

Parameters:

  array | Array of vectors

void VisiMath.Matrix4.TransformFast | ( | IVertexArray | array | ) |

Transforms all positions and normals in array of vertex by the matrix.

Parameters:

  array | Array of vectors

void VisiMath.Matrix4.TransformFast | ( | Vector3[] | array | ) |

Transforms all vectors in array by the matrix, ignoring the 4th row for normal transformations without perspective change.

Parameters:

  array | Array of vectors

void VisiMath.Matrix4.TransformFast | ( | ref Vector3 | vec | ) |

Faster transformation of the vector for matrices with fourth row 0 0 0 1 (normal transformation matrices)

Parameters:

  vec |

void VisiMath.Matrix4.TransformFast | ( | IVertex[] | array | ) |

Transforms all positions and normals in array of vertex by the matrix, fast version not using 4 th row.

Parameters:

  array | Array of vectors

void VisiMath.Matrix4.TransformInverted | ( | ref Vector3 | vec | ) |

Inverse transformation of the vector. Works ONLY for matrices with rotation and translation.

Parameters:

  vec |

void VisiMath.Matrix4.TransformNormal | ( | ref Vector3 | vec | ) |

Transforms Normal, uses slow invert.transpose.transform of rotation matrix. For transformations with uniform scaling use TransformNormalFast or store transformation matrix by yourself.

Parameters:

  vec |

void VisiMath.Matrix4.TransformNormalFast | ( | ref Vector3 | vec | ) |

rotates normal - note, works correctly only for transformations with uniform scaling! Use TransformNormal for (slow) correct computation

Parameters:

  vec | Normal to be rotated

void VisiMath.Matrix4.Transpose | ( |  | ) |

Transposes matrix.

static Matrix4 VisiMath.Matrix4.Transpose | ( | ref Matrix4 | mat | ) | `[static]`

Returns transposed matrix.

Parameters:

  mat | Matrix to transpose

Returns:
  Transposed matrix

## Member Data Documentation

Matrix4 VisiMath.Matrix4.camrot`[static]`

Initial value:

     new Matrix4(
                0, 0, 1, 0,
                1, 0, 0, 0,
                0, -1, 0, 0,
                0, 0, 0, 1)

Matrix4 VisiMath.Matrix4.Identitity = new Matrix4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)`[static]`

Identity matrix.

float VisiMath.Matrix4.m00

float VisiMath.Matrix4.m01

float VisiMath.Matrix4.m02

float VisiMath.Matrix4.m03

float VisiMath.Matrix4.m10

float VisiMath.Matrix4.m11

float VisiMath.Matrix4.m12

float VisiMath.Matrix4.m13

float VisiMath.Matrix4.m20

float VisiMath.Matrix4.m21

float VisiMath.Matrix4.m22

float VisiMath.Matrix4.m23

float VisiMath.Matrix4.m30

float VisiMath.Matrix4.m31

float VisiMath.Matrix4.m32

float VisiMath.Matrix4.m33

Matrix4 VisiMath.Matrix4.RotationX180`[static]`

Initial value:

     new Matrix4(
                1, 0, 0, 0,
                0, -1, 0, 0,
                0, 0, -1, 0,
                0, 0, 0, 1)

Matrix4 VisiMath.Matrix4.RotationX270`[static]`

Initial value:

     new Matrix4(
                1, 0, 0, 0,
                0, 0, 1, 0,
                0, -1, 0, 0,
                0, 0, 0, 1)

Matrix4 VisiMath.Matrix4.RotationX90`[static]`

Initial value:

     new Matrix4(
                1, 0, 0, 0,
                0, 0, -1, 0,
                0, 1, 0, 0,
                0, 0, 0, 1)

Static rotation 90 degrees around the X axis.

Matrix4 VisiMath.Matrix4.RotationY90`[static]`

Initial value:

     new Matrix4(
                0, 0, 0, 1,
                0, 1, 0, 0,
                -1, 0, 0, 0,
                0, 0, 0, 1)

Static rotation 90 degrees around the Y axis.

Matrix4 VisiMath.Matrix4.RotationZ180`[static]`

Initial value:

     new Matrix4(
                -1, 0, 0, 0,
                0, -1, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1)

Matrix4 VisiMath.Matrix4.RotationZ270`[static]`

Initial value:

     new Matrix4(
                0, 1, 0, 0,
                -1, 0, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1)

Matrix4 VisiMath.Matrix4.RotationZ90`[static]`

Initial value:

     new Matrix4(
                0, -1, 0, 0,
                1, 0, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1)

Static rotation 90 degrees around the Z axis.

## Property Documentation

Vector4 VisiMath.Matrix4.Column0`[get, set]`

Vector4 VisiMath.Matrix4.Column1`[get, set]`

Vector4 VisiMath.Matrix4.Column2`[get, set]`

Vector4 VisiMath.Matrix4.Column3`[get, set]`

float VisiMath.Matrix4.Determinant`[get]`

Matrix3 VisiMath.Matrix4.Rotation`[get, set]`

Rotational matrix.

Vector4 VisiMath.Matrix4.Row0`[get, set]`

Vector4 VisiMath.Matrix4.Row1`[get, set]`

Vector4 VisiMath.Matrix4.Row2`[get, set]`

Vector4 VisiMath.Matrix4.Row3`[get, set]`

float VisiMath.Matrix4.this[int index1, int index2]`[get, set]`

Index acessor, maps internal fields to [index1, index2].

Parameters:

  index1 | Row index
  index2 | Column index

Exceptions:

  System.ArgumentOutOfRangeException | Thrown if index used is not 0-3

float VisiMath.Matrix4.this[int index]`[get, set]`

Index acessor, maps internal fields to one dimensional array.

Parameters:

  index | index

Exceptions:

  System.ArgumentOutOfRangeException | Thrown if index used is not 0-15

Vector3 VisiMath.Matrix4.Translation`[get, set]`

Translation vector.

The documentation for this struct was generated from the following file:

- Matrix4.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events