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: SWMatrix

  • xOffset: integer|nil

  • yOffset: integer|nil

  • zOffset: integer|nil

Returns

  • SWMatrix


Noir.Libraries.Matrix:Empty()

Returns an empty matrix. Equivalent to matrix.translation(0, 0, 0)

Returns

  • SWMatrix


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: number

  • scaleY: number

  • scaleZ: number

Returns

  • SWMatrix


Offset a matrix by a random amount.

Parameters

  • pos: SWMatrix

  • xRange: number

  • yRange: number

  • zRange: number

Returns

  • SWMatrix


Converts a matrix to a readable format.

Parameters

  • pos: SWMatrix

Returns

  • string


Returns the magnitude of a matrix's XYZ vector.

Parameters

  • pos: SWMatrix

Returns

  • number

Last updated