## Documentation

- Overview
- Website
- Tutorials
- Class Index

## Classes

- _global_
- CL3D
- CL3D.AnimatedMeshSceneNode
- CL3D.Animator
- CL3D.AnimatorAnimateTexture
- CL3D.AnimatorCameraFPS
- CL3D.AnimatorCameraModelViewer
- CL3D.AnimatorCollisionResponse
- CL3D.AnimatorFlyCircle
- CL3D.AnimatorFlyStraight
- CL3D.AnimatorFollowPath
- CL3D.AnimatorOnClick
- CL3D.AnimatorOnProximity
- CL3D.AnimatorRotation
- CL3D.BillboardSceneNode
- CL3D.BoundingBoxTriangleSelector
- CL3D.Box3d
- CL3D.CameraSceneNode
- CL3D.ColorF
- CL3D.CopperCubeVariable
- CL3D.CopperLicht
- CL3D.CubeSceneNode
- CL3D.HotspotSceneNode
- CL3D.Light
- CL3D.LightSceneNode
- CL3D.Line3d
- CL3D.Material
- CL3D.Matrix4
- CL3D.Mesh
- CL3D.MeshBuffer
- CL3D.MeshSceneNode
- CL3D.MeshTriangleSelector
- CL3D.MetaTriangleSelector
- CL3D.Mobile2DInputSceneNode
- CL3D.OctTreeTriangleSelector
- CL3D.Overlay2DSceneNode
- CL3D.ParticleSystemSceneNode
- CL3D.PathSceneNode
- CL3D.Plane3d
- CL3D.Quaternion
- CL3D.Renderer
- CL3D.Scene
- CL3D.SceneNode
- CL3D.SkyBoxSceneNode
- CL3D.SoundSceneNode
- CL3D.TerrainSceneNode
- CL3D.Texture
- CL3D.TextureManager
- CL3D.Triangle3d
- CL3D.TriangleSelector
- CL3D.Vect2d
- CL3D.Vect3d
- CL3D.Vertex3D
- CL3D.WaterSurfaceSceneNode

CopperLicht API Documentation

# Class CL3D.Matrix4

A 4x4 matrix, mostly used as transformation matrix for 3d calculations.

Class Overview
CL3D.Matrix4(bMakeIdentity)
A 4x4 matrix. Mostly used as transformation matrix for 3d calculations. The matrix is a D3D style matrix, row major with translations in the 4th row.

Parameters:
{Boolean} bMakeIdentity
  If set to true, the matrix will initially have stored the identity matrix.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| asArray() Returns the content of this matrix as array
| buildCameraLookAtMatrixLH(position, target, upVector) Builds a left-handed look-at matrix.
| buildProjectionMatrixPerspectiveFovLH(fieldOfViewRadians, aspectRatio, zNear, zFar) Builds a left-handed perspective projection matrix based on a field of view.
| buildProjectionMatrixPerspectiveOrthoLH(widthOfViewVolume, heightOfViewVolume, zNear, zFar) Builds a left-handed orthogonal projection matrix.
| buildProjectionMatrixPerspectiveOrthoRH(widthOfViewVolume, heightOfViewVolume, zNear, zFar) Builds a left-handed orthogonal projection matrix.
| clone() Creates a clone of this matrix
| copyTo(mat) Copies the content of this matrix to a target matrix
| equals(mat) Returns if this matrix equals another matrix, uses CL3D.equals as comparison operator.
| getInverse(out) Copies the inverse of this matrix into the output matrix, returns true succcessful.
| getRotatedVect(v) Returns a new vector, rotated from the input vector by this matrix
| getRotationDegrees() Returns the rotation, as set by setRotation().
| getScale() Returns the scle stored in the matrix as 3d vector
| getTransformedVect(v) returns a new transformed vector from the input vector
| getTranslatedVect(v) Translates a input vector by this matrix and returns it as new vector.
| getTranslation() Returns the translation stored in the matrix as 3d vector
| getTransposed() Returns a transposed version of this matrix
| inverseRotateVect(v) Rotate a vector by the inverse of the rotation part of this matrix.
| isIdentity() Returns if this matrix is the identity matrix
| isTranslateOnly() returns if only the translation is set in the matrix
| makeIdentity() Makes this matrix the identitiy matrix
| makeInverse() Inverts this matrix, returns true if successful
| multiply(m2) Multiplies this matrix with another matrix, returns the result as a new matrix.
| multiplyWith1x4Matrix(v) Multiplies this matrix with a 4D Vector (expects components X, Y, Z and W), result is stored in the input vector
| multiplyWith1x4Matrix2(v) same as multiplyWith1x4Matrix, but faster and returns w as value
| rotateVect(v) Rotates a 3d vector by this matrix.
| rotateVect2(out, inp) Rotates an input vector and stores the result in the output paramter
| setByIndex(i, n) Sets a value of the matrix by index
| setRotationDegrees(v) Make a rotation matrix from Euler angles.
| setRotationRadians(rotation) Make a rotation matrix from Euler angles.
| setScale(v) Sets the scale of the matrix
| setScaleXYZ(x, y, z) Sets the scale of the matrix
| setTranslation(v) Set the translation of the current matrix.
| toString() Returns a string representation of this matrix.
| transformBoxEx(box) Transforms a 3d box
| transformBoxEx2(box) Transforms a 3d box with another method which is more exact than transformBoxEx
| transformPlane(plane) Transforms a 3d plane by this matrix
| transformVect(v) Transforms the input vector by this matrix
| transformVect2(out, inp) Transforms the input vector by this matrix and stores the result in the ouput parameter
| translateVect(v) Translates a vector by this matrix

Method Detail
{Array} asArray()
Returns the content of this matrix as array

Returns:
  {Array} array of this matrix.

buildCameraLookAtMatrixLH(position, target, upVector)
Builds a left-handed look-at matrix.

Parameters:
position
target
upVector

buildProjectionMatrixPerspectiveFovLH(fieldOfViewRadians, aspectRatio, zNear, zFar)
Builds a left-handed perspective projection matrix based on a field of view.

Parameters:
fieldOfViewRadians
aspectRatio
zNear
zFar

buildProjectionMatrixPerspectiveOrthoLH(widthOfViewVolume, heightOfViewVolume, zNear, zFar)
Builds a left-handed orthogonal projection matrix.

Parameters:
widthOfViewVolume
heightOfViewVolume
zNear
zFar

buildProjectionMatrixPerspectiveOrthoRH(widthOfViewVolume, heightOfViewVolume, zNear, zFar)
Builds a left-handed orthogonal projection matrix.

Parameters:
widthOfViewVolume
heightOfViewVolume
zNear
zFar

clone()
Creates a clone of this matrix

copyTo(mat)
Copies the content of this matrix to a target matrix

Parameters:
mat

equals(mat)
Returns if this matrix equals another matrix, uses CL3D.equals as comparison operator.

Parameters:
mat

getInverse(out)
Copies the inverse of this matrix into the output matrix, returns true succcessful.

Parameters:
out

getRotatedVect(v)
Returns a new vector, rotated from the input vector by this matrix

Parameters:
v

{CL3D.Vect3d} getRotationDegrees()
Returns the rotation, as set by setRotation(). Returns a rotation that is equivalent to that set by setRotationDegrees().

Returns:
  {CL3D.Vect3d} rotation vector

{CL3D.Vect3d} getScale()
Returns the scle stored in the matrix as 3d vector

Returns:
  {CL3D.Vect3d} scale vector

getTransformedVect(v)
returns a new transformed vector from the input vector

Parameters:
v

getTranslatedVect(v)
Translates a input vector by this matrix and returns it as new vector.

Parameters:
v

{CL3D.Vect3d} getTranslation()
Returns the translation stored in the matrix as 3d vector

Returns:
  {CL3D.Vect3d} translation vector

getTransposed()
Returns a transposed version of this matrix

inverseRotateVect(v)
Rotate a vector by the inverse of the rotation part of this matrix.

Parameters:
v

isIdentity()
Returns if this matrix is the identity matrix

isTranslateOnly()
returns if only the translation is set in the matrix

makeIdentity()
Makes this matrix the identitiy matrix

makeInverse()
Inverts this matrix, returns true if successful

multiply(m2)
Multiplies this matrix with another matrix, returns the result as a new matrix.

Parameters:
m2

multiplyWith1x4Matrix(v)
Multiplies this matrix with a 4D Vector (expects components X, Y, Z and W), result is stored in the input vector

Parameters:
v

multiplyWith1x4Matrix2(v)
same as multiplyWith1x4Matrix, but faster and returns w as value

Parameters:
v

rotateVect(v)
Rotates a 3d vector by this matrix.

Parameters:
v

rotateVect2(out, inp)
Rotates an input vector and stores the result in the output paramter

Parameters:
out
inp

setByIndex(i, n)
Sets a value of the matrix by index

Parameters:
i
  Index in the matrix, a value between 0 and 15
n
  Value to set

setRotationDegrees(v)
Make a rotation matrix from Euler angles. The 4th row and column are unmodified.

Parameters:
{CL3D.Vect3d} v
  rotation vector

setRotationRadians(rotation)
Make a rotation matrix from Euler angles. The 4th row and column are unmodified.

Parameters:
{CL3D.Vect3d} rotation
  rotation vector

setScale(v)
Sets the scale of the matrix

Parameters:
{CL3D.Vect3d} v
  translation vector

setScaleXYZ(x, y, z)
Sets the scale of the matrix

Parameters:
x
y
z

setTranslation(v)
Set the translation of the current matrix. Will erase any previous values.

Parameters:
{CL3D.Vect3d} v
  translation vector

toString()
Returns a string representation of this matrix.

transformBoxEx(box)
Transforms a 3d box

Parameters:
{CL3D.Box3d} box

transformBoxEx2(box)
Transforms a 3d box with another method which is more exact than transformBoxEx

Parameters:
{CL3D.Box3d} box

transformPlane(plane)
Transforms a 3d plane by this matrix

Parameters:
plane

transformVect(v)
Transforms the input vector by this matrix

Parameters:
v

transformVect2(out, inp)
Transforms the input vector by this matrix and stores the result in the ouput parameter

Parameters:
out
inp

translateVect(v)
Translates a vector by this matrix

Parameters:
v

© 2011-2018 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit