Home Reference Source Repository
import Matrix from 'dh3dlib/js/base/Matrix.js'
public class | source

Matrix

matrix class

Constructor Summary

Public Constructor
public

constructor(matrix: Matrix | array)

constructor

Member Summary

Public Members
public

m11: float

public

m12: float

public

m13: float

public

m14: float

public

m21: float

public

m22: float

public

m23: float

public

m24: float

public

m31: float

public

m32: float

public

m33: float

public

m34: float

public

m41: float

public

m42: float

public

m43: float

public

m44: float

Method Summary

Public Methods
public

clone(): *

public

copyMatrix(src: Matrix): void

copy matrix

public

getArray(): array

get array format value of matrix for WebGL

public

get Float32Array format value of matrix for WebGL

public

get Float32Array format value of transposed matrix for WebGL

public

identity(): void

reset matrix

public

inverseMatrix(src: Matrix): void

inverse matrix

public

lerp(src1: Matrix, src2: Matrix, rate: float): void

blend 2 matrices.

public

set rotation matrix from quaternion

public

multiplyMatrix(src1: Matrix, src2: Matrix): void

multiply matrix (src1 x src2), set result to this matrix

public

rotate(mat: Matrix, angle: float, x: float, y: float, z: float): void

rotate matrix

public

scale(mat: Matrix, x: float, y: float, z: float): void

scale matrix

public

showMatrix(): void

show matrix value to console for debug

public

translate(mat: Matrix, x: float, y: float, z: float): void

translate matrix

public

transposeMatrix(src: Matrix): void

transpose matrix

Public Constructors

public constructor(matrix: Matrix | array) source

constructor

Params:

NameTypeAttributeDescription
matrix Matrix | array

a

Public Members

public m11: float source

public m12: float source

public m13: float source

public m14: float source

public m21: float source

public m22: float source

public m23: float source

public m24: float source

public m31: float source

public m32: float source

public m33: float source

public m34: float source

public m41: float source

public m42: float source

public m43: float source

public m44: float source

Public Methods

public clone(): * source

Return:

*

public copyMatrix(src: Matrix): void source

copy matrix

Params:

NameTypeAttributeDescription
src Matrix

Return:

void

public getArray(): array source

get array format value of matrix for WebGL

Return:

array

matrix value

public getWebGLFloatArray(): Float32Array source

get Float32Array format value of matrix for WebGL

Return:

Float32Array

matrix value

public getWebGLFloatArrayTransposed(): Float32Array source

get Float32Array format value of transposed matrix for WebGL

Return:

Float32Array

transposed matrix value

public identity(): void source

reset matrix

Return:

void

public inverseMatrix(src: Matrix): void source

inverse matrix

Params:

NameTypeAttributeDescription
src Matrix

Return:

void

public lerp(src1: Matrix, src2: Matrix, rate: float): void source

blend 2 matrices. if rate is 0, result is equal to src1. if rate is 1, result is equal to src2.

Params:

NameTypeAttributeDescription
src1 Matrix
src2 Matrix
rate float

Return:

void

public matrixFromQuaternion(quat: Vector4): void source

set rotation matrix from quaternion

Params:

NameTypeAttributeDescription
quat Vector4

Quaternion

Return:

void

public multiplyMatrix(src1: Matrix, src2: Matrix): void source

multiply matrix (src1 x src2), set result to this matrix

Params:

NameTypeAttributeDescription
src1 Matrix
src2 Matrix

Return:

void

public rotate(mat: Matrix, angle: float, x: float, y: float, z: float): void source

rotate matrix

Params:

NameTypeAttributeDescription
mat Matrix
angle float
x float
y float
z float

Return:

void

public scale(mat: Matrix, x: float, y: float, z: float): void source

scale matrix

Params:

NameTypeAttributeDescription
mat Matrix
x float
y float
z float

Return:

void

public showMatrix(): void source

show matrix value to console for debug

Return:

void

public translate(mat: Matrix, x: float, y: float, z: float): void source

translate matrix

Params:

NameTypeAttributeDescription
mat Matrix
x float
y float
z float

Return:

void

public transposeMatrix(src: Matrix): void source

transpose matrix

Params:

NameTypeAttributeDescription
src Matrix

Return:

void