Module content.scripts.mat4🔗
global record Mat4Serialized
new: function(Vec4Serialized.Vec4, Vec4Serialized.Vec4, Vec4Serialized.Vec4, Vec4Serialized.Vec4): Mat4 identity: function(): Mat4 add: function(Mat4, Mat4): Mat4 sub: function(Mat4, Mat4): Mat4 mul: function(Mat4, Mat4): Mat4 gemv: function(m : Mat4, v : Vec4Serialized.Vec4): Vec4Serialized.Vec4 flipY: function(m : Mat4): Mat4 transl: function(t : Vec3Serialized.Vec3): Mat4 scale: function(t : Vec3Serialized.Vec3): Mat4 rotZ: function(rotZ : number): Mat4 rotY: function(rotY : number): Mat4 rotX: function(rotX : number): Mat4 rotZTransl: function(rotZ : number, transl : Vec3Serialized.Vec3): Mat4 rotZYXTransl: function(rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 rotZYTransl: function(rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 rotYCntTransl: function(rotY : number, cnt : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 rotZY: function(rot : Vec3Serialized.Vec3): Mat4 scaleRotZTransl: function(scale : number, rotZ : number, transl : Vec3Serialized.Vec3): Mat4 scaleXYZRotZTransl: function(scale : Vec3Serialized.Vec3, rotZ : number, transl : Vec3Serialized.Vec3): Mat4 scaleRotZYXTransl: function(scale : Vec3Serialized.Vec3, rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 getTransl: function(m : Mat4): Vec3Serialized.Vec3 print: function(v : Mat4): string end
Category: globals🔗
Mat4Serialized🔗
global record Mat4Serialized
new: function(Vec4Serialized.Vec4, Vec4Serialized.Vec4, Vec4Serialized.Vec4, Vec4Serialized.Vec4): Mat4 identity: function(): Mat4 add: function(Mat4, Mat4): Mat4 sub: function(Mat4, Mat4): Mat4 mul: function(Mat4, Mat4): Mat4 gemv: function(m : Mat4, v : Vec4Serialized.Vec4): Vec4Serialized.Vec4 flipY: function(m : Mat4): Mat4 transl: function(t : Vec3Serialized.Vec3): Mat4 scale: function(t : Vec3Serialized.Vec3): Mat4 rotZ: function(rotZ : number): Mat4 rotY: function(rotY : number): Mat4 rotX: function(rotX : number): Mat4 rotZTransl: function(rotZ : number, transl : Vec3Serialized.Vec3): Mat4 rotZYXTransl: function(rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 rotZYTransl: function(rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 rotYCntTransl: function(rotY : number, cnt : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 rotZY: function(rot : Vec3Serialized.Vec3): Mat4 scaleRotZTransl: function(scale : number, rotZ : number, transl : Vec3Serialized.Vec3): Mat4 scaleXYZRotZTransl: function(scale : Vec3Serialized.Vec3, rotZ : number, transl : Vec3Serialized.Vec3): Mat4 scaleRotZYXTransl: function(scale : Vec3Serialized.Vec3, rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4 getTransl: function(m : Mat4): Vec3Serialized.Vec3 print: function(v : Mat4): string end
Mat4Serialized.Mat4🔗
Mat4Serialized.Mat4.$meta.__add🔗
metamethod Mat4Serialized.Mat4.$meta.__add(Mat4, Mat4): Mat4Parameters
Mat4Mat4
Mat4
Mat4Serialized.Mat4.$meta.__sub🔗
metamethod Mat4Serialized.Mat4.$meta.__sub(Mat4, Mat4): Mat4Parameters
Mat4Mat4
Mat4
Mat4Serialized.Mat4.$meta.__mul🔗
metamethod Mat4Serialized.Mat4.$meta.__mul(Mat4, Mat4): Mat4Parameters
Mat4Mat4
Mat4
Mat4Serialized.new🔗
function Mat4Serialized.new(Vec4Serialized.Vec4, Vec4Serialized.Vec4, Vec4Serialized.Vec4, Vec4Serialized.Vec4): Mat4Parameters
Vec4Serialized.Vec4Vec4Serialized.Vec4Vec4Serialized.Vec4Vec4Serialized.Vec4
Mat4
Mat4Serialized.identity🔗
function Mat4Serialized.identity(): Mat4Returns
Mat4
Mat4Serialized.add🔗
function Mat4Serialized.add(Mat4, Mat4): Mat4Parameters
Mat4Mat4
Mat4
Mat4Serialized.sub🔗
function Mat4Serialized.sub(Mat4, Mat4): Mat4Parameters
Mat4Mat4
Mat4
Mat4Serialized.mul🔗
function Mat4Serialized.mul(Mat4, Mat4): Mat4Parameters
Mat4Mat4
Mat4
Mat4Serialized.gemv🔗
function Mat4Serialized.gemv(m : Mat4, v : Vec4Serialized.Vec4): Vec4Serialized.Vec4
General matrix-vector multiplication.
Parametersm:Mat4— matrixv:Vec4Serialized.Vec4— vector
Vec4Serialized.Vec4— resulting vector
Mat4Serialized.flipY🔗
function Mat4Serialized.flipY(m : Mat4): Mat4
Multiply the y coordinate of each column with -1.
Parametersm:Mat4— matrix
Mat4— matrix with Y flipped
Mat4Serialized.transl🔗
function Mat4Serialized.transl(t : Vec3Serialized.Vec3): Mat4
Create translation matrix from a translation vector.
Parameterst:Vec3Serialized.Vec3— translation vector
Mat4— translation matrix
Mat4Serialized.scale🔗
function Mat4Serialized.scale(t : Vec3Serialized.Vec3): Mat4
Create scale matrix.
Parameterst:Vec3Serialized.Vec3— scale vector
Mat4— scale matrix
Mat4Serialized.rotZ🔗
function Mat4Serialized.rotZ(rotZ : number): Mat4
Create rotation matrix for the rotation around Z axis.
ParametersrotZ:number— rotation angle in radians
Mat4— rotation matrix
Mat4Serialized.rotY🔗
function Mat4Serialized.rotY(rotY : number): Mat4
Create rotation matrix for the rotation around Y axis.
ParametersrotY:number— rotation angle in radians
Mat4— rotation matrix
Mat4Serialized.rotX🔗
function Mat4Serialized.rotX(rotX : number): Mat4
Create rotation matrix around X axis.
ParametersrotX:number— rotation angle in radians
Mat4— rotation matrix
Mat4Serialized.rotZTransl🔗
function Mat4Serialized.rotZTransl(rotZ : number, transl : Vec3Serialized.Vec3): Mat4
Create matrix who has rotation around Z and translation
ParametersrotZ:number— rotation angletransl:Vec3Serialized.Vec3— translation vector
Mat4— combined matrix
Mat4Serialized.rotZYXTransl🔗
function Mat4Serialized.rotZYXTransl(rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4
Create matrix for ZYX rotations and translation.
Parametersrot:Vec3Serialized.Vec3— rotation vector (x is rotZ, y is rotY, z is rotX) and performed in this ordertransl:Vec3Serialized.Vec3— translation vector
Mat4— combined matrix
Mat4Serialized.rotZYTransl🔗
function Mat4Serialized.rotZYTransl(rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4
Create a matrix for ZY rotations and translation.
Parametersrot:Vec3Serialized.Vec3— rotation vector (x is rotZ, y is rotY, z is unused) and performed in this ordertransl:Vec3Serialized.Vec3— translation vector
Mat4— combined matrix
Mat4Serialized.rotYCntTransl🔗
function Mat4Serialized.rotYCntTransl(rotY : number, cnt : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4
Create matrix for rotation around Y with a center specified and a translation.
ParametersrotY:number— rotation anglecnt:Vec3Serialized.Vec3— center pointtransl:Vec3Serialized.Vec3— translation vector
Mat4— combined matrix
Mat4Serialized.rotZY🔗
function Mat4Serialized.rotZY(rot : Vec3Serialized.Vec3): Mat4
Create a matrix for ZY rotations.
Parametersrot:Vec3Serialized.Vec3— rotation vector (x is rotZ, y is rotY, z is unused) and performed in this order
Mat4— rotation matrix
Mat4Serialized.scaleRotZTransl🔗
function Mat4Serialized.scaleRotZTransl(scale : number, rotZ : number, transl : Vec3Serialized.Vec3): Mat4
Create matrix for (homogenous) scaling, rotation around Z, and translation.
Parametersscale:number— scale factorrotZ:number— rotation angletransl:Vec3Serialized.Vec3— translation vector
Mat4— combined matrix
Mat4Serialized.scaleXYZRotZTransl🔗
function Mat4Serialized.scaleXYZRotZTransl(scale : Vec3Serialized.Vec3, rotZ : number, transl : Vec3Serialized.Vec3): Mat4
Create matrix for (inhomogenous) scaling, rotation around Z, and translation.
Parametersscale:Vec3Serialized.Vec3— scale vectorrotZ:number— rotation angletransl:Vec3Serialized.Vec3— translation vector
Mat4— combined matrix
Mat4Serialized.scaleRotZYXTransl🔗
function Mat4Serialized.scaleRotZYXTransl(scale : Vec3Serialized.Vec3, rot : Vec3Serialized.Vec3, transl : Vec3Serialized.Vec3): Mat4
Create matrix for (inhomogenous) scaling, ZYX rotations and translation.
Parametersscale:Vec3Serialized.Vec3— scale vectorrot:Vec3Serialized.Vec3— rotation vector (x is rotZ, y is rotY, z is rotX) and performed in this ordertransl:Vec3Serialized.Vec3— translation vector
Mat4— combined matrix
Mat4Serialized.getTransl🔗
function Mat4Serialized.getTransl(m : Mat4): Vec3Serialized.Vec3
Extract translation vector from matrix.
Parametersm:Mat4— matrix
Vec3Serialized.Vec3— translation vector
Mat4Serialized.print🔗
function Mat4Serialized.print(v : Mat4): string
Convert matrix to a string representation.
Parametersv:Mat4— matrix
string— string representation