API Docs for: 0.0.2
Show:

Atlantis.Matrix Class

Module: Framework
Parent Module: Atlantis

Create a matrix. Parameter can be a matrix, an array of 16 floats or nothing (all fields case are sets to 0).

Constructor

Atlantis.Matrix

(
  • UNKNOWN
)

Parameters:

Methods

add

(
  • matA
  • matB
)
Atlantis.Matrix static

Add two matrix.

Parameters:

Returns:

Atlantis.Matrix:

Return a new matrix.

add

(
  • matrix
)

Add a matrix to this matrix.

Parameters:

createOrthograhic

(
  • width
  • height
  • zNear
  • zFar
)
Atlantis.Matrix static

Create an orthogonal projection matrix.

Parameters:

Returns:

createOrthographicOffCenter

(
  • width
  • height
  • zNear
  • zFar
)
Atlantis.Matrix static

Create a customized orthogonal projection matrix.

Parameters:

Returns:

createPerspectiveFieldOfView

(
  • fov
  • aspect
  • near
  • far
)
Atlantis.Matrix static

Create a perspective field of view matrix with Left hand notation.

Parameters:

  • fov Number

    Desired field of view (Math.PI / 4 is a good value)

  • aspect Number

    Desired aspect ratio (Screen width / height)

  • near Number

    Near clip

  • far Number

    Far clip

Returns:

Atlantis.Matrix:

Return a matrix of this type of perspective.

createPerspectiveFieldOfViewRH

(
  • fov
  • aspect
  • near
  • far
)
Atlantis.Matrix static

Create a perspective field of view matrix with Right hand notation.

Parameters:

  • fov Number

    Desired field of view (Math.PI / 4 is a good value)

  • aspect Number

    Desired aspect ratio (Screen width / height)

  • near Number

    Near clip

  • far Number

    Far clip

Returns:

Atlantis.Matrix:

Return a matrix of this type of perspective.

createPerspectiveOffCenter

(
  • left
  • right
  • bottom
  • top
  • zNear
  • zFar
)
Atlantis.Matrix static

Create a custom perspective matrix.

Parameters:

  • left Number

    Minimum X value of the viewing volume.

  • right Number

    Maximum X value of the viewing volume.

  • bottom Number

    Minimum Y value of the viewing volume.

  • top Number

    Maximum Y value of the viewing volume.

  • zNear Number

    Minimum Z value of the viewing volume.

  • zFar Number

    Maximum Z value of the viewing volume.

Returns:

Atlantis.Matrix:

Return a new custom perspective matrix.

createPerspectiveOffCenter

(
  • left
  • right
  • bottom
  • top
  • zNear
  • zFar
)
Atlantis.Matrix static

Create a custom perspective matrix (Right hand).

Parameters:

  • left Number

    Minimum X value of the viewing volume.

  • right Number

    Maximum X value of the viewing volume.

  • bottom Number

    Minimum Y value of the viewing volume.

  • top Number

    Maximum Y value of the viewing volume.

  • zNear Number

    Minimum Z value of the viewing volume.

  • zFar Number

    Maximum Z value of the viewing volume.

Returns:

Atlantis.Matrix:

Return a new custom perspective matrix.

createRotationX

(
  • rotation
)
Atlantis.Matrix static

Create a rotation matrix on X axis.

Parameters:

Returns:

Atlantis.Matrix:

Return a rotation matrix on X axis.

createRotationX

(
  • rotation
)
Atlantis.Matrix static

Create a rotation matrix on Z axis.

Parameters:

Returns:

Atlantis.Matrix:

Return a rotation matrix on Z axis.

createRotationY

(
  • rotation
)
Atlantis.Matrix static

Create a rotation matrix on Y axis.

Parameters:

Returns:

Atlantis.Matrix:

Return a rotation matrix on Y axis.

createScale

(
  • sx
  • sy
  • sz
)
Atlantis.Matrix static

Create a scale matrix.

Parameters:

  • sx Number

    Desired scale on X axis.

  • sy Number

    Desired scale on Y axis.

  • sz Number

    Desired scale on Z axis.

Returns:

Atlantis.Matrix:

Return a scale matrix.

createTranslation

(
  • x
  • y
  • z
)
static

Create a translation matrix.

Parameters:

Returns:

Return a matrix translation.

createWorld

(
  • position
  • forward
  • upVector
)
Atlantis.Matrix static

Create a world matrix.

Parameters:

Returns:

Atlantis.Matrix:

Return a world matrix.

getBackward

() Atlantis.Matrix

Gets the backward of the matrix.

Returns:

Atlantis.Matrix:

Return a the backward vector of the matrix.

getDown

() Atlantis.Matrix

Gets the down of the matrix.

Returns:

Atlantis.Matrix:

Return a the down vector of the matrix.

getForward

() Atlantis.Matrix

Gets the forward of the matrix.

Returns:

Atlantis.Matrix:

Return a the forward vector of the matrix.

getIdentityValues

() Array

Gets identity value for push it into matrix.

Returns:

Array:

Return an array that correspond of identity matrix.

getLeft

() Atlantis.Matrix

Gets the left of the matrix.

Returns:

Atlantis.Matrix:

Return a the left vector of the matrix.

getMatrixIdentity

() Atlantis.Matrix static

Gets an identity matrix.

Returns:

Atlantis.Matrix:

Return an identity matrix.

getRight

() Atlantis.Matrix

Gets the right of the matrix.

Returns:

Atlantis.Matrix:

Return a the right vector of the matrix.

getUp

() Atlantis.Matrix

Gets the up of the matrix.

Returns:

Atlantis.Matrix:

Return a the up vector of the matrix.

getZeroValues

() Array

Gets an array of values setted to 0.

Returns:

Array:

Return an array with 0.

invert

()

Invert the current Matrix.

invert

(
  • matrix
)
Atlantis.Matrix static

Calculate the inverse of the specified matrix.

Parameters:

  • matrix Object

    The matrix to use.

Returns:

Atlantis.Matrix:

Return the inverse of the matrix.

multiply

(
  • matrixA
  • matrixB
  • matrixC
)
Atlantis.Matrix static

Multiply a two matrix.

Parameters:

Returns:

Atlantis.Matrix:

Return a new matrix.

multiply

(
  • matrix
)

Multiply this matrix by another matrix.

Parameters:

set

(
  • values
)

Set all values of the matrix.

Parameters:

  • values Array

    An array of 16 values who start at M11 and stop at M44

setBackward

(
  • vector
)

Sets the backward of the matrix.

Parameters:

setDown

(
  • vector
)

Sets the down of the matrix.

Parameters:

setForward

(
  • vector
)

Sets the forward of the matrix.

Parameters:

setIdentity

()

Sets the matrix to identity.

setLeft

(
  • vector
)

Sets the left of the matrix.

Parameters:

setRight

(
  • vector
)

Sets the right of the matrix.

Parameters:

setTranslation

(
  • position
)

Sets translation.

Parameters:

  • position Atlantis.Vetor3

    The position to set.

setUp

(
  • vector
)

Sets the up of the matrix.

Parameters:

subtract

(
  • matrix
)

Subtract a matrix to this matrix.

Parameters:

subtract

(
  • matA
  • matB
)
Atlantis.Matrix static

Subtract two matrix.

Parameters:

Returns:

Atlantis.Matrix:

Return a new matrix.

toArray

() Array

Gets values of matrix in array. Start at M11 to M44.

Returns:

Array:

An array of values.

toString

() String

Gets a string from this object.

Returns: