Class TransformUtil

java.lang.Object
org.boxutil.util.TransformUtil

public final class TransformUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport)
     
    createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport, org.lwjgl.util.vector.Matrix4f result)
     
    createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport)
     
    createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport, org.lwjgl.util.vector.Matrix4f result)
     
    createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget)
     
    createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget, org.lwjgl.util.vector.Matrix4f result)
     
    createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget)
     
    createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrix(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector3f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrix(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrix3f(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix3f
    createModelMatrix3f(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix3f result)
     
    createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector2f location, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector3f location, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixLocationScale(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Vector3f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixLocationScale(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixRotateOnly(org.lwjgl.util.vector.Quaternion rotate, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixRotateOnly(org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Matrix4f result)
    Better than Matrix4f.rotate(float, Vector3f, Matrix4f).
    createModelMatrixScaleOnly(org.lwjgl.util.vector.Vector3f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixScaleOnly(org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixVanilla(float facing, org.lwjgl.util.vector.Vector2f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixVanilla(float facing, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Matrix4f result)
    With default override scale value 1.0f.
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Matrix4f result)
    With default override scale value 1.0f.
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector2f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Vector2f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector3f location, float facing, org.lwjgl.util.vector.Vector3f scale, int writePosition, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    createModelMatrixVanilla(org.lwjgl.util.vector.Vector3f location, float facing, org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result)
     
    createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar)
     
    createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar, org.lwjgl.util.vector.Matrix4f result)
     
    createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar)
     
    createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar, org.lwjgl.util.vector.Matrix4f result)
     
    static org.lwjgl.util.vector.Matrix2f
    createSimpleRadiansRotateMatrix(float angRad, org.lwjgl.util.vector.Matrix2f result)
     
    static org.lwjgl.util.vector.Matrix2f
    createSimpleRotateMatrix(float angle, org.lwjgl.util.vector.Matrix2f result)
     
    static org.lwjgl.util.vector.Matrix2f
    createSimpleRotateMatrix(org.lwjgl.util.vector.Vector2f vector, org.lwjgl.util.vector.Matrix2f result)
     
    static org.lwjgl.util.vector.Matrix2f
    createSimpleRotateMatrix(org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to, org.lwjgl.util.vector.Matrix2f result)
     
     
    createWindowCenterOrthoMatrix(boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createWindowCenterOrthoMatrix(int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createWindowCenterOrthoMatrix(org.lwjgl.util.vector.Matrix4f result)
     
     
    createWindowOrthoMatrix(boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    createWindowOrthoMatrix(int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it.
    static org.lwjgl.util.vector.Matrix4f
    createWindowOrthoMatrix(org.lwjgl.util.vector.Matrix4f result)
     
    static org.lwjgl.util.vector.Vector2f
    getRadiansRotateBase(float angRad, org.lwjgl.util.vector.Vector2f result)
     
    static org.lwjgl.util.vector.Vector2f
    getRotateBase(float angle, org.lwjgl.util.vector.Vector2f result)
     
    static org.lwjgl.util.vector.Vector2f
    getWorldLocationAtViewportUV(org.lwjgl.util.vector.Vector2f location, com.fs.starfarer.api.combat.ViewportAPI viewport)
     
    static org.lwjgl.util.vector.Vector2f
    getWorldLocationAtViewportUV(org.lwjgl.util.vector.Vector2f location, com.fs.starfarer.api.combat.ViewportAPI viewport, org.lwjgl.util.vector.Vector2f result)
     
    static org.lwjgl.util.vector.Matrix2f
    inverseRotate(org.lwjgl.util.vector.Matrix2f rotate)
     
    static org.lwjgl.util.vector.Matrix2f
    inverseRotate(org.lwjgl.util.vector.Matrix2f rotate, org.lwjgl.util.vector.Matrix2f result)
     
    invertModelMatrix2D(org.lwjgl.util.vector.Matrix4f src, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    invertModelMatrix2D(org.lwjgl.util.vector.Matrix4f src, org.lwjgl.util.vector.Matrix4f result)
     
    invertModelMatrix3D(org.lwjgl.util.vector.Matrix4f src, int writePosition, boolean eraseAndWrite, FloatBuffer result)
    Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
    static org.lwjgl.util.vector.Matrix4f
    invertModelMatrix3D(org.lwjgl.util.vector.Matrix4f src, org.lwjgl.util.vector.Matrix4f result)
     
    static org.lwjgl.util.vector.Matrix4f
    makeStateMatrix(org.lwjgl.util.vector.Matrix4f result, org.lwjgl.util.vector.Matrix4f... matrices)
    Order is m1 * m2 * m3 ...
    static org.lwjgl.util.vector.Vector2f
    pointRadiansRotateTranslate(org.lwjgl.util.vector.Vector2f point, float angRad, org.lwjgl.util.vector.Vector2f offset, org.lwjgl.util.vector.Vector2f result)
    Rotate then translate.
    static org.lwjgl.util.vector.Vector2f
    pointRotateTranslate(org.lwjgl.util.vector.Vector2f point, float angle, org.lwjgl.util.vector.Vector2f offset, org.lwjgl.util.vector.Vector2f result)
    Rotate then translate.
    static org.lwjgl.util.vector.Vector2f
    pointTranslateRadiansRotate(org.lwjgl.util.vector.Vector2f point, float angRad, org.lwjgl.util.vector.Vector2f offset, org.lwjgl.util.vector.Vector2f result)
    Translate then rotate.
    static org.lwjgl.util.vector.Vector2f
    pointTranslateRotate(org.lwjgl.util.vector.Vector2f point, float angle, org.lwjgl.util.vector.Vector2f offset, org.lwjgl.util.vector.Vector2f result)
    Translate then rotate.
    static org.lwjgl.util.vector.Quaternion
    rotationFacingOnly(float yaw)
    z-axis
    static org.lwjgl.util.vector.Quaternion
    rotationFacingOnly(float yaw, org.lwjgl.util.vector.Quaternion result)
    z-axis
    static org.lwjgl.util.vector.Quaternion
    rotationXOnly(float pitch)
     
    static org.lwjgl.util.vector.Quaternion
    rotationXOnly(float pitch, org.lwjgl.util.vector.Quaternion result)
     
    static org.lwjgl.util.vector.Quaternion
    rotationYOnly(float roll)
     
    static org.lwjgl.util.vector.Quaternion
    rotationYOnly(float roll, org.lwjgl.util.vector.Quaternion result)
     
    static org.lwjgl.util.vector.Quaternion
    rotationZXY(float yaw, float pitch, float roll)
    ZXY order.
    static org.lwjgl.util.vector.Quaternion
    rotationZXY(float yaw, float pitch, float roll, org.lwjgl.util.vector.Quaternion result)
    ZXY order.
    static org.lwjgl.util.vector.Quaternion
    rotationZXY(org.lwjgl.util.vector.Vector3f rotate)
     
    static org.lwjgl.util.vector.Quaternion
    rotationZXY(org.lwjgl.util.vector.Vector3f rotate, org.lwjgl.util.vector.Quaternion result)
     

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • invertModelMatrix2D

      public static org.lwjgl.util.vector.Matrix4f invertModelMatrix2D(org.lwjgl.util.vector.Matrix4f src, @Nullable org.lwjgl.util.vector.Matrix4f result)
      Returns:
      null when determinants got zero.
    • invertModelMatrix2D

      public static FloatBuffer invertModelMatrix2D(org.lwjgl.util.vector.Matrix4f src, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 9 at least, and recommended to create it from an identity matrix.
      Returns:
      will not write anything when determinants got zero.
    • invertModelMatrix3D

      public static org.lwjgl.util.vector.Matrix4f invertModelMatrix3D(org.lwjgl.util.vector.Matrix4f src, @Nullable org.lwjgl.util.vector.Matrix4f result)
      Returns:
      null when determinants got zero.
    • invertModelMatrix3D

      public static FloatBuffer invertModelMatrix3D(org.lwjgl.util.vector.Matrix4f src, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 9 at least, and recommended to create it from an identity matrix.
      Returns:
      will not write anything when determinants got zero.
    • makeStateMatrix

      public static org.lwjgl.util.vector.Matrix4f makeStateMatrix(@Nullable org.lwjgl.util.vector.Matrix4f result, org.lwjgl.util.vector.Matrix4f... matrices)
      Order is m1 * m2 * m3 ... and more.

      For usual 3d game, perspectiveMatrix * viewMatrix * modelMatrix

    • rotationFacingOnly

      public static org.lwjgl.util.vector.Quaternion rotationFacingOnly(float yaw, @Nullable org.lwjgl.util.vector.Quaternion result)
      z-axis
    • rotationFacingOnly

      public static org.lwjgl.util.vector.Quaternion rotationFacingOnly(float yaw)
      z-axis
    • rotationXOnly

      public static org.lwjgl.util.vector.Quaternion rotationXOnly(float pitch, @Nullable org.lwjgl.util.vector.Quaternion result)
    • rotationXOnly

      public static org.lwjgl.util.vector.Quaternion rotationXOnly(float pitch)
    • rotationYOnly

      public static org.lwjgl.util.vector.Quaternion rotationYOnly(float roll, @Nullable org.lwjgl.util.vector.Quaternion result)
    • rotationYOnly

      public static org.lwjgl.util.vector.Quaternion rotationYOnly(float roll)
    • rotationZXY

      public static org.lwjgl.util.vector.Quaternion rotationZXY(float yaw, float pitch, float roll, @Nullable org.lwjgl.util.vector.Quaternion result)
      ZXY order.
      Parameters:
      yaw - z's angle
      pitch - x's angle
      roll - y's angle
    • rotationZXY

      public static org.lwjgl.util.vector.Quaternion rotationZXY(float yaw, float pitch, float roll)
      ZXY order.
      Parameters:
      yaw - z's angle
      pitch - x's angle
      roll - y's angle
    • rotationZXY

      public static org.lwjgl.util.vector.Quaternion rotationZXY(org.lwjgl.util.vector.Vector3f rotate, @Nullable org.lwjgl.util.vector.Quaternion result)
    • rotationZXY

      public static org.lwjgl.util.vector.Quaternion rotationZXY(org.lwjgl.util.vector.Vector3f rotate)
    • getRadiansRotateBase

      public static org.lwjgl.util.vector.Vector2f getRadiansRotateBase(float angRad, @Nullable org.lwjgl.util.vector.Vector2f result)
    • getRotateBase

      public static org.lwjgl.util.vector.Vector2f getRotateBase(float angle, @Nullable org.lwjgl.util.vector.Vector2f result)
    • createSimpleRotateMatrix

      public static org.lwjgl.util.vector.Matrix2f createSimpleRotateMatrix(org.lwjgl.util.vector.Vector2f vector, @Nullable org.lwjgl.util.vector.Matrix2f result)
    • createSimpleRotateMatrix

      public static org.lwjgl.util.vector.Matrix2f createSimpleRotateMatrix(org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to, @Nullable org.lwjgl.util.vector.Matrix2f result)
    • createSimpleRadiansRotateMatrix

      public static org.lwjgl.util.vector.Matrix2f createSimpleRadiansRotateMatrix(float angRad, @Nullable org.lwjgl.util.vector.Matrix2f result)
    • createSimpleRotateMatrix

      public static org.lwjgl.util.vector.Matrix2f createSimpleRotateMatrix(float angle, @Nullable org.lwjgl.util.vector.Matrix2f result)
    • inverseRotate

      public static org.lwjgl.util.vector.Matrix2f inverseRotate(org.lwjgl.util.vector.Matrix2f rotate, @Nullable org.lwjgl.util.vector.Matrix2f result)
    • inverseRotate

      public static org.lwjgl.util.vector.Matrix2f inverseRotate(org.lwjgl.util.vector.Matrix2f rotate)
    • pointTranslateRadiansRotate

      public static org.lwjgl.util.vector.Vector2f pointTranslateRadiansRotate(org.lwjgl.util.vector.Vector2f point, float angRad, org.lwjgl.util.vector.Vector2f offset, @Nullable org.lwjgl.util.vector.Vector2f result)
      Translate then rotate.
    • pointTranslateRotate

      public static org.lwjgl.util.vector.Vector2f pointTranslateRotate(org.lwjgl.util.vector.Vector2f point, float angle, org.lwjgl.util.vector.Vector2f offset, @Nullable org.lwjgl.util.vector.Vector2f result)
      Translate then rotate.
    • pointRadiansRotateTranslate

      public static org.lwjgl.util.vector.Vector2f pointRadiansRotateTranslate(org.lwjgl.util.vector.Vector2f point, float angRad, org.lwjgl.util.vector.Vector2f offset, @Nullable org.lwjgl.util.vector.Vector2f result)
      Rotate then translate.
    • pointRotateTranslate

      public static org.lwjgl.util.vector.Vector2f pointRotateTranslate(org.lwjgl.util.vector.Vector2f point, float angle, org.lwjgl.util.vector.Vector2f offset, @Nullable org.lwjgl.util.vector.Vector2f result)
      Rotate then translate.
    • createModelMatrixLocationOnly

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector3f location, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixLocationOnly

      public static FloatBuffer createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector3f location, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixLocationOnly

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector2f location, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixLocationOnly

      public static FloatBuffer createModelMatrixLocationOnly(org.lwjgl.util.vector.Vector2f location, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixRotateOnly

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixRotateOnly(org.lwjgl.util.vector.Quaternion rotate, @Nullable org.lwjgl.util.vector.Matrix4f result)
      Better than Matrix4f.rotate(float, Vector3f, Matrix4f).
    • createModelMatrixRotateOnly

      public static FloatBuffer createModelMatrixRotateOnly(org.lwjgl.util.vector.Quaternion rotate, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixScaleOnly

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixScaleOnly(org.lwjgl.util.vector.Vector3f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixScaleOnly

      public static FloatBuffer createModelMatrixScaleOnly(org.lwjgl.util.vector.Vector3f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixLocationScale

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixLocationScale(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Vector3f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixLocationScale

      public static FloatBuffer createModelMatrixLocationScale(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Vector3f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixVanilla

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixVanilla(org.lwjgl.util.vector.Vector3f location, float facing, org.lwjgl.util.vector.Vector3f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixVanilla

      public static FloatBuffer createModelMatrixVanilla(org.lwjgl.util.vector.Vector3f location, float facing, org.lwjgl.util.vector.Vector3f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixVanilla

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector2f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixVanilla

      public static FloatBuffer createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector2f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixVanilla

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, @Nullable org.lwjgl.util.vector.Matrix4f result)
      With default override scale value 1.0f.
    • createModelMatrixVanilla

      public static FloatBuffer createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.

      With default override scale value 1.0f.

      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixVanilla

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixVanilla

      public static FloatBuffer createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixVanilla

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, @Nullable org.lwjgl.util.vector.Matrix4f result)
      With default override scale value 1.0f.
    • createModelMatrixVanilla

      public static FloatBuffer createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.

      With default override scale value 1.0f.

      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixVanilla

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixVanilla(float facing, org.lwjgl.util.vector.Vector2f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixVanilla

      public static FloatBuffer createModelMatrixVanilla(float facing, org.lwjgl.util.vector.Vector2f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrixVanilla

      public static org.lwjgl.util.vector.Matrix4f createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Vector2f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createModelMatrixVanilla

      public static FloatBuffer createModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Vector2f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • createModelMatrix3f

      public static org.lwjgl.util.vector.Matrix3f createModelMatrix3f(@Nullable org.lwjgl.util.vector.Vector2f location, float facing, @Nullable org.lwjgl.util.vector.Vector2f scale, @Nullable org.lwjgl.util.vector.Matrix3f result)
      Parameters:
      facing - without rotate when Float.NaN.
      scale - hava default value {1.0f, 1.0f} if this parameter is null but facing not a NaN.
    • createModelMatrix3f

      public static FloatBuffer createModelMatrix3f(@Nullable org.lwjgl.util.vector.Vector2f location, float facing, @Nullable org.lwjgl.util.vector.Vector2f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      facing - without rotate when Float.NaN.
      scale - hava default value {1.0f, 1.0f} if this parameter is null but facing not a NaN.
      result - the writable size must be 9 at least, and recommended to create it from an identity matrix.
    • createModelMatrix

      public static org.lwjgl.util.vector.Matrix4f createModelMatrix(@Nullable org.lwjgl.util.vector.Vector3f location, @Nullable org.lwjgl.util.vector.Quaternion rotate, @Nullable org.lwjgl.util.vector.Vector3f scale, @Nullable org.lwjgl.util.vector.Matrix4f result)
      Parameters:
      scale - hava default value {1.0f, 1.0f, 1.0f} if this parameter is null but rotate not null.
    • createModelMatrix

      public static FloatBuffer createModelMatrix(@Nullable org.lwjgl.util.vector.Vector3f location, @Nullable org.lwjgl.util.vector.Quaternion rotate, @Nullable org.lwjgl.util.vector.Vector3f scale, int writePosition, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it, also will not erase buffer.
      Parameters:
      scale - hava default value {1.0f, 1.0f, 1.0f} if this parameter is null but rotate not null.
      result - the writable size must be 16 at least, and recommended to create it from an identity matrix.
    • getWorldLocationAtViewportUV

      public static org.lwjgl.util.vector.Vector2f getWorldLocationAtViewportUV(org.lwjgl.util.vector.Vector2f location, com.fs.starfarer.api.combat.ViewportAPI viewport, @Nullable org.lwjgl.util.vector.Vector2f result)
    • getWorldLocationAtViewportUV

      public static org.lwjgl.util.vector.Vector2f getWorldLocationAtViewportUV(org.lwjgl.util.vector.Vector2f location, com.fs.starfarer.api.combat.ViewportAPI viewport)
    • createGameOrthoMatrix

      public static org.lwjgl.util.vector.Matrix4f createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createGameOrthoMatrix

      public static FloatBuffer createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createGameOrthoMatrix

      public static FloatBuffer createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createGameOrthoMatrix

      public static FloatBuffer createGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport)
    • createGamePerspectiveMatrix

      public static org.lwjgl.util.vector.Matrix4f createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createGamePerspectiveMatrix

      public static FloatBuffer createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createGamePerspectiveMatrix

      public static FloatBuffer createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createGamePerspectiveMatrix

      public static FloatBuffer createGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport)
    • createWindowCenterOrthoMatrix

      public static org.lwjgl.util.vector.Matrix4f createWindowCenterOrthoMatrix(@Nullable org.lwjgl.util.vector.Matrix4f result)
    • createWindowCenterOrthoMatrix

      public static FloatBuffer createWindowCenterOrthoMatrix(int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createWindowCenterOrthoMatrix

      public static FloatBuffer createWindowCenterOrthoMatrix(boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createWindowCenterOrthoMatrix

      public static FloatBuffer createWindowCenterOrthoMatrix()
    • createWindowOrthoMatrix

      public static org.lwjgl.util.vector.Matrix4f createWindowOrthoMatrix(@Nullable org.lwjgl.util.vector.Matrix4f result)
    • createWindowOrthoMatrix

      public static FloatBuffer createWindowOrthoMatrix(int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createWindowOrthoMatrix

      public static FloatBuffer createWindowOrthoMatrix(boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createWindowOrthoMatrix

      public static FloatBuffer createWindowOrthoMatrix()
    • createOrthoMatrix

      public static org.lwjgl.util.vector.Matrix4f createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createOrthoMatrix

      public static FloatBuffer createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createOrthoMatrix

      public static FloatBuffer createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createOrthoMatrix

      public static FloatBuffer createOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar)
    • createLookAtMatrix3D

      public static org.lwjgl.util.vector.Matrix4f createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createLookAtMatrixFlat

      public static org.lwjgl.util.vector.Matrix4f createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget, @Nullable org.lwjgl.util.vector.Matrix4f result)
    • createLookAtMatrix3D

      public static FloatBuffer createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createLookAtMatrix3D

      public static FloatBuffer createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createLookAtMatrix3D

      public static FloatBuffer createLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget)
    • createLookAtMatrixFlat

      public static FloatBuffer createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createLookAtMatrixFlat

      public static FloatBuffer createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      result - the writable size must be 16 at least.
    • createLookAtMatrixFlat

      public static FloatBuffer createLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget)
    • createPerspectiveMatrix3D

      public static org.lwjgl.util.vector.Matrix4f createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar, @Nullable org.lwjgl.util.vector.Matrix4f result)
      Parameters:
      aspect - width / height
    • createPerspectiveMatrix3D

      public static FloatBuffer createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar, int writePosition, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      aspect - width / height
      result - the writable size must be 16 at least.
    • createPerspectiveMatrix3D

      public static FloatBuffer createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar, boolean eraseAndWrite, @NotNull FloatBuffer result)
      Use for directly write into buffer, and will not change the position of it.
      Parameters:
      aspect - width / height
      result - the writable size must be 16 at least.
    • createPerspectiveMatrix3D

      public static FloatBuffer createPerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar)
      Parameters:
      aspect - width / height