Matrix Class
Matrix class
Constructor
Matrix
()
Item Index
Methods
frustum
-
l
-
r
-
b
-
t
-
n
-
f
Sets up a viewing frustum, which is shaped like a truncated pyramid with the camera where the point of the pyramid would be. This emulates the OpenGL
Parameters:
-
l
FloatLeft
-
r
FloatRight
-
b
FloatBottom
-
t
FloatTop
-
n
FloatNear
-
f
FloatFar
Returns:
Result matrix
inverse
()
Matrix
Returns the matrix that when multiplied with this matrix results in the identity matrix.
Returns:
Inverted matrix
lookAt
-
e
-
c
-
u
Create a matrix that puts the camera at the eye point ex, ey, ez
looking
toward the center point cx, cy, cz
with an up direction of ux, uy, uz
.
Returns:
Result matrix
multiply
-
matrix
Concatenates the transforms for this matrix and matrix
.
Parameters:
-
matrix
MatrixMatrix to multiply
Returns:
Multiplied matrix
ortho
-
l
-
r
-
b
-
t
-
n
-
f
Creates an orthographic projection, in which objects are the same size no matter how far away or nearby they are.
Parameters:
-
l
FloatLeft
-
r
FloatRight
-
b
FloatBottom
-
t
FloatTop
-
n
FloatNear
-
f
FloatFar
Returns:
Result matrix
orthoPerspective
-
fov
-
aspect
-
near
-
far
Sets up an ortho perspective transform. The aspect
argument is the width divided by the height
of your viewport and fov
is the top-to-bottom angle of the field of view in
degrees.
Parameters:
-
fov
FloatField of View
-
aspect
FloatAspect ratio
-
near
FloatNear plane
-
far
FloatFar plane
Returns:
Result matrix
perspective
-
fov
-
aspect
-
near
-
far
Sets up a perspective transform, which makes far away objects appear smaller
than nearby objects. The aspect
argument is the width divided by the height
of your viewport and fov
is the top-to-bottom angle of the field of view in
degrees.
Parameters:
-
fov
FloatField of View
-
aspect
FloatAspect ratio
-
near
FloatNear plane
-
far
FloatFar plane
Returns:
Result matrix
rotate
-
a
-
x
-
y
-
z
Creates a matrix that rotates by a
degrees around the vector x, y, z
.
Parameters:
-
a
FloatAngle in degrees
-
x
FloatVector X value
-
y
FloatVector Y value
-
z
FloatVector Z value
Returns:
Result matrix
rotate
-
xAngle
-
yAngle
-
zAngle
Creates a matrix that rotates in three axes x, y, z
.
Parameters:
-
xAngle
Floatin degrees
-
yAngle
Floatin degrees
-
zAngle
Floatin degrees
Returns:
Result matrix
scale
-
x
-
y
-
z
Creates a matrix that scales by the vector x, y, z
.
Parameters:
-
x
FloatVector X value
-
y
FloatVector Y value
-
z
FloatVector Z value
Returns:
Result matrix
toInverseMat3
()
Matrix3
Returns the matrix that when multiplied with this matrix results in the identity matrix3.
Returns:
Inverted matrix3
transformPoint
()
Vector
Transforms the vector as a point with a w coordinate of 1. This means translations will have an effect, for example.
Returns:
Transformed Vector
transformVector
()
Vector
Transforms the vector as a vector with a w coordinate of 0. This means translations will have no effect, for example.
Returns:
Transformed Vector