Naev

Module transform

Lua bindings to interact with transforms.

Functions

__eq (t1, t2) Compares two transforms to see if they are the same.
new () Creates a new identity transform.Gets a transform.
__mul (A, B) Multiplies two transforms (A*B).
get (T) Gets all the values of the transform.
scale (T, x, y, z) Applies scaling to a transform.
translate (T, x, y, z) Applies translation to a transform.
rotate2d (T, angle) Applies a 2D rotation (along Z-axis) to a transform.
applyPoint (T, x, y, z) Applies a trasnformation to a point.
applyDim (T, x, y, z) Applies a trasnformation to a dimension.


Functions

__eq (t1, t2)
Compares two transforms to see if they are the same.

Parameters:

  • t1 Transform Transform 1 to compare.
  • t2 Transform Transform 2 to compare.

Returns:

    boolean true if both transforms are the same.
new ()
Creates a new identity transform.Gets a transform.

Returns:

    Transform A new transform corresponding to an identity matrix.
__mul (A, B)
Multiplies two transforms (A*B).

Parameters:

  • A Transform First element to multiply.
  • B Transform Second element to multiply.

Returns:

    Transform Result of multiplication.
get (T)
Gets all the values of the transform.

Parameters:

  • T Transform Transform te get parameters of.

Returns:

    table 2D table containing all the values of the transform.
scale (T, x, y, z)
Applies scaling to a transform.

Parameters:

  • T Transform Transform to apply scaling to.
  • x number X-axis scaling.
  • y number Y-axis scaling.
  • z number Z-axis scaling.

Returns:

    Transform A new transformation.
translate (T, x, y, z)
Applies translation to a transform.

Parameters:

  • T Transform Transform to apply translation to.
  • x number X-axis translation.
  • y number Y-axis translation.
  • z number Z-axis translation.

Returns:

    Transform A new transformation.
rotate2d (T, angle)
Applies a 2D rotation (along Z-axis) to a transform.

Parameters:

  • T Transform Transform to apply rotation to.
  • angle number Angle to rotate (radians).
applyPoint (T, x, y, z)
Applies a trasnformation to a point.

Parameters:

  • T Transform Transform to apply.
  • x number Point X-coordinate.
  • y number Point Y-coordinate.
  • z number Point Z-coordinate.

Returns:

  1. number New X coordinate.
  2. number New Y coordinate.
  3. number New Z coordinate.
applyDim (T, x, y, z)
Applies a trasnformation to a dimension.

Note This is similar to Transform.applyPoint, except the translation is not applied.

Parameters:

  • T Transform Transform to apply.
  • x number Dimension X-coordinate.
  • y number Dimension Y-coordinate.
  • z number Dimension Z-coordinate.

Returns:

  1. number New X coordinate.
  2. number New Y coordinate.
  3. number New Z coordinate.
generated by LDoc 1.4.6 Last updated 2021-01-17 05:05:08