vrmatrix3
Module: Maths
A matrix.
#include <lua_api.h>
Public Functions
Type | Name |
---|---|
vrmatrix4 | applyScale(Any v) (vrMatScale) Return M scaled by vector V. If V is a scalar then a vector in which x=v, y=v, z=v will be used. |
Any | copy() (vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane |
number | determinant() (vrMatDeterminant) Returns the determinant of the matrix |
number | get(number x, number y) (vrMatGetValue) Get the value of an element of a matrix. |
Any | getTranspose() (vrMatTranspose) Returns the tranpose of a 3x3 matrix, or a 4x4 matrix with the 3x3 component transposed. |
Any | normalise() (vrNormalise) Returns normalised vector/matrix. |
Any | operator*() |
Any | operator+() |
Any | operator-() |
Any | operator/() |
Any | operator=() |
Any | orthoNormalise() (vrMatOrthoNormalise) Returns an orthogonal matrix. |
vrmatrix4 | rotateX(number v) (vrMatRotateEulerX) Return M rotated on the X axis by angle V. |
vrmatrix4 | rotateY(number v) (vrMatRotateEulerY) Return M rotated on the Y axis by angle V. |
vrmatrix4 | rotateZ(number v) (vrMatRotateEulerZ) Return M rotated on the Z axis by angle V. |
void | set(number x, number y, number v) (vrMatSetValue) Set the value of an element of a matrix. |
string | toString() (vrMatToString) Get a string representation of a matrix. |
vrmatrix4 | translate(vrvec3](../classes/vrvec3.mdx) v) (vrMatTranslate) Return M translated by the vector V. |
Public Attributes
Type | Name |
---|---|
vrvec3 | forward Forward vector. |
vrvec3 | right Right vector. |
vrvec3 | up Up vector. |
Public Functions Documentation
applyScale
vrmatrix4 applyScale(
Any v
)
(vrMatScale) Return M scaled by vector V. If V is a scalar then a vector in which x=v, y=v, z=v will be used.
Parameters:
- v The vector or scalar to scale M by.
copy
Any copy()
(vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane
determinant
number determinant()
(vrMatDeterminant) Returns the determinant of the matrix
get
number get(
number x,
number y
)
(vrMatGetValue) Get the value of an element of a matrix.
Parameters:
- x The column of the element to select.
- y The row of the element to select.
getTranspose
Any getTranspose()
(vrMatTranspose) Returns the tranpose of a 3x3 matrix, or a 4x4 matrix with the 3x3 component transposed.
Return: vrmat3 or vrmat4 depending on the type passed in
normalise
Any normalise()
(vrNormalise) Returns normalised vector/matrix.
Return: Normalised vector or matrix depending on the type passed in
operator*
Any operator*()
operator+
Any operator+()
operator-
Any operator-()
operator/
Any operator/()
operator=
Any operator=()
orthoNormalise
Any orthoNormalise()
(vrMatOrthoNormalise) Returns an orthogonal matrix.
Return: Orthogonal mat3 or mat4 depending on the type passed in
rotateX
vrmatrix4 rotateX(
number v
)
(vrMatRotateEulerX) Return M rotated on the X axis by angle V.
Parameters:
- v The angle to rotate M by.
rotateY
vrmatrix4 rotateY(
number v
)
(vrMatRotateEulerY) Return M rotated on the Y axis by angle V.
Parameters:
- v The angle to rotate M by.
rotateZ
vrmatrix4 rotateZ(
number v
)
(vrMatRotateEulerZ) Return M rotated on the Z axis by angle V.
Parameters:
- v The angle to rotate M by.
set
void set(
number x,
number y,
number v
)
(vrMatSetValue) Set the value of an element of a matrix.
Parameters:
- x The column of the element to select.
- y The row of the element to select.
- v The value to set the element.
toString
string toString()
(vrMatToString) Get a string representation of a matrix.
translate
vrmatrix4 translate(
vrvec3 v
)
(vrMatTranslate) Return M translated by the vector V.
Parameters:
- v The vector to translate the matrix by.
Public Attributes Documentation
forward
vrvec3 forward;
Forward vector.
right
vrvec3 right;
Right vector.
up
vrvec3 up;
Up vector.