Developer Documentation

Matrix data type used for scripting

The matrix type Matrix4x4 is used in the scripting language to handle matrix operations. The implementation of the type for scripting can be found in prototypeMatrix4x4 .

You can use the following functions:

var matrix = Matrix4x4(1,0,0,1,
0,1,0,2,
0,0,1,3,
0,0,0,1 ) // Create a matrix that contains only a translation (1,2,3).
var vec = Vector(1,2,3) // Create a vector
var vec2 = matrix.transform_point(vec); // Transforms a point by the given matrix (translation is included)
var vec3 = matrix.transform_vector(vec); // Transforms a vector by the given matrix (translation is omitted)