Matrix
Noir.Libraries.Matrix: NoirLibrary
A library containing helper methods relating to Stormworks matrices.
Noir.Libraries.Matrix:Offset(pos, xOffset, yOffset, zOffset)Offsets the position of a matrix.
Parameters
pos: SWMatrixxOffset: integer|nilyOffset: integer|nilzOffset: integer|nil
Returns
SWMatrix
Noir.Libraries.Matrix:Empty()Returns an empty matrix. Equivalent to matrix.translation(0, 0, 0)
Returns
SWMatrix
Noir.Libraries.Matrix:Scale(scaleX, scaleY, scaleZ)Returns a scaled matrix. Multiply this with another matrix to scale up said matrix.
This can be used to enlarge vehicles spawned via server.spawnAddonComponent, server.spawnAddonVehicle, etc.
Parameters
scaleX: numberscaleY: numberscaleZ: number
Returns
SWMatrix
Noir.Libraries.Matrix:RandomOffset(pos, xRange, yRange, zRange)Offset a matrix by a random amount.
Parameters
pos: SWMatrixxRange: numberyRange: numberzRange: number
Returns
SWMatrix
Noir.Libraries.Matrix:ToString(pos)Converts a matrix to a readable format.
Parameters
pos: SWMatrix
Returns
string
Noir.Libraries.Matrix:Magnitude(pos)Returns the magnitude of a matrix's XYZ vector.
Parameters
pos: SWMatrix
Returns
number
Last updated