Static methods

@:value({ offset : 0 })staticinlinefromFloat32Array(a:Float32Array, offset:Int = 0):Mat4

Set all components of this matrix from an array.

Parameters:

a

The 16-component array to use. Components should be in the same order as for Mat4.new().

offset

An offset index to the start of the data in the array. Defaults to 0.

Returns:

A new matrix.

staticinlineidentity():Mat4

Create a matrix that represents no transform - located at the origin, zero rotation, and a uniform scale of 1.

Returns:

A new matrix.

staticinlineortho(left:FastFloat, right:FastFloat, bottom:FastFloat, top:FastFloat, near:FastFloat, far:FastFloat):Mat4

Create a new orthographic projection matrix.

Parameters:

left

The left of the box.

right

The right of the box.

bottom

The bottom of the box.

top

The top of the box.

near

The depth of the near floor of the box.

far

The depth of the far floor of the box.

Returns:

A new matrix.

staticinlinepersp(fovY:FastFloat, aspect:FastFloat, zn:FastFloat, zf:FastFloat):Mat4

Create a new perspective projection matrix.

Parameters:

fovY

The vertical field of view.

aspect

The aspect ratio.

zn

The depth of the near floor of the frustum.

zf

The depth of the far floor of the frustum.

Returns:

A new matrix.

Constructor

inlinenew(_00:FastFloat, _10:FastFloat, _20:FastFloat, _30:FastFloat, _01:FastFloat, _11:FastFloat, _21:FastFloat, _31:FastFloat, _02:FastFloat, _12:FastFloat, _22:FastFloat, _32:FastFloat, _03:FastFloat, _13:FastFloat, _23:FastFloat, _33:FastFloat)

Variables

Methods

inlineapplyQuat(q:Quat):Void

Apply an additional rotation to this matrix.

Parameters:

q

The quaternion to rotate by.

inlineclone():Mat4

Create a copy of this matrix.

Returns:

A new matrix.

inlinecompose(loc:Vec4, quat:Quat, sc:Vec4):Mat4

Set the transform from a location, rotation and scale.

Parameters:

loc

The location to use.

quat

The rotation to use.

sc

The scale to use.

Returns:

This matrix.

inlinedecompose(loc:Vec4, quat:Quat, scale:Vec4):Mat4

Decompose this matrix into its location, rotation and scale components. Additional transforms (skew, projection) will be ignored.

Parameters:

loc

A vector to write the location to.

quat

A quaternion to write the rotation to.

scale

A vector to write the scale to.

Returns:

This matrix.

inlinefromQuat(q:Quat):Mat4

Set the transform to a rotation from a quaternion. Other existing transforms will be removed.

Parameters:

q

The rotation to use.

Returns:

This matrix.

inlinegetInverse(m:Mat4):Mat4

Invert a matrix and store the result in this one.

Parameters:

m

The matrix to invert.

Returns:

This matrix.

inlinegetLoc():Vec4

Get the location component.

Returns:

A new vector.

inlinegetScale():Vec4

Get the scale component.

Returns:

A new vector.

@:value({ z : 0.0, y : 0.0, x : 0.0 })inlineinitTranslate(x:FastFloat = 0.0, y:FastFloat = 0.0, z:FastFloat = 0.0):Mat4

Reset this matrix to the identity and set its location.

Parameters:

x

The x location.

y

The y location.

z

The z location.

Returns:

This matrix.

inlinelook():Vec4

Returns:

The look vector; the positive y axis of the space defined by this matrix.

inlinemult(s:FastFloat):Mat4

Multiply this vector by a scalar.

Parameters:

s

The value to multiply by.

Returns:

This matrix.

inlinemultmat(m:Mat4):Mat4

inlinemultmats(b:Mat4, a:Mat4):Mat4

inlineright():Vec4

Returns:

The right vector; the positive x axis of the space defined by this matrix.

inlinescale(v:Vec4):Mat4

Apply an additional scale to this matrix.

Parameters:

v

The vector to scale by.

Returns:

This matrix.

@:value({ offset : 0 })inlinesetF32(a:Float32Array, offset:Int = 0):Mat4

inlinesetFrom(m:Mat4):Mat4

inlinesetIdentity():Mat4

Set this matrix to the identity (see identity()).

Returns:

This matrix.

inlinesetLoc(v:Vec4):Mat4

Set the location component of this matrix.

Parameters:

v

The location to use.

Returns:

This matrix.

inlinesetLookAt(eye:Vec4, center:Vec4, up:Vec4):Mat4

inlinetoRotation():Mat4

Convert this matrix to a rotation matrix, and discard location and scale information.

Returns:

This matrix.

inlinetranslate(x:FastFloat, y:FastFloat, z:FastFloat):Mat4

Apply an additional translation to this matrix.

Parameters:

x

The distance to move in the x direction.

y

The distance to move in the x direction.

z

The distance to move in the x direction.

Returns:

This matrix

inlinetranspose():Mat4

Transpose this matrix.

Returns:

This matrix.

inlineup():Vec4

Returns:

The up vector; the positive z axis of the space defined by this matrix.