Package org.boxutil.util
Class TransformUtil
java.lang.Object
org.boxutil.util.TransformUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic FloatBuffercreateGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport) static FloatBuffercreateGameOrthoMatrix(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.static FloatBuffercreateGameOrthoMatrix(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.Matrix4fcreateGameOrthoMatrix(com.fs.starfarer.api.combat.ViewportAPI viewport, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport) static FloatBuffercreateGamePerspectiveMatrix(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.static FloatBuffercreateGamePerspectiveMatrix(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.Matrix4fcreateGamePerspectiveMatrix(float fovAngle, com.fs.starfarer.api.combat.ViewportAPI viewport, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateLookAtMatrix3D(org.lwjgl.util.vector.Vector3f camera, org.lwjgl.util.vector.Vector3f target, org.lwjgl.util.vector.Vector3f up, boolean offsetFromTarget) static FloatBuffercreateLookAtMatrix3D(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.static FloatBuffercreateLookAtMatrix3D(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.Matrix4fcreateLookAtMatrix3D(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) static FloatBuffercreateLookAtMatrixFlat(org.lwjgl.util.vector.Vector2f camera, org.lwjgl.util.vector.Vector2f target, org.lwjgl.util.vector.Vector2f up, boolean offsetFromTarget) static FloatBuffercreateLookAtMatrixFlat(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.static FloatBuffercreateLookAtMatrixFlat(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.Matrix4fcreateLookAtMatrixFlat(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) static FloatBuffercreateModelMatrix(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.Matrix4fcreateModelMatrix(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrix3f(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.Matrix3fcreateModelMatrix3f(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix3f result) static FloatBuffercreateModelMatrixLocationOnly(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.Matrix4fcreateModelMatrixLocationOnly(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixLocationOnly(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.Matrix4fcreateModelMatrixLocationOnly(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixLocationScale(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.Matrix4fcreateModelMatrixLocationScale(org.lwjgl.util.vector.Vector3f location, org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixRotateOnly(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.Matrix4fcreateModelMatrixRotateOnly(org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Matrix4f result) Better thanMatrix4f.rotate(float, Vector3f, Matrix4f).static FloatBuffercreateModelMatrixScaleOnly(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.Matrix4fcreateModelMatrixScaleOnly(org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixVanilla(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.Matrix4fcreateModelMatrixVanilla(float facing, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixVanilla(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.Matrix4fcreateModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Matrix4f result) With default override scale value1.0f.static FloatBuffercreateModelMatrixVanilla(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.Matrix4fcreateModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixVanilla(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.Matrix4fcreateModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Matrix4f result) With default override scale value1.0f.static FloatBuffercreateModelMatrixVanilla(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.Matrix4fcreateModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Quaternion rotate, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixVanilla(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.Matrix4fcreateModelMatrixVanilla(org.lwjgl.util.vector.Vector2f location, org.lwjgl.util.vector.Vector2f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateModelMatrixVanilla(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.Matrix4fcreateModelMatrixVanilla(org.lwjgl.util.vector.Vector3f location, float facing, org.lwjgl.util.vector.Vector3f scale, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreateOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar) static FloatBuffercreateOrthoMatrix(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.static FloatBuffercreateOrthoMatrix(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.Matrix4fcreateOrthoMatrix(float left, float right, float bottom, float top, float zNear, float zFar, org.lwjgl.util.vector.Matrix4f result) static FloatBuffercreatePerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar) static FloatBuffercreatePerspectiveMatrix3D(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.static FloatBuffercreatePerspectiveMatrix3D(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.Matrix4fcreatePerspectiveMatrix3D(float fovAngle, float aspect, float zNear, float zFar, org.lwjgl.util.vector.Matrix4f result) static org.lwjgl.util.vector.Matrix2fcreateSimpleRadiansRotateMatrix(float angRad, org.lwjgl.util.vector.Matrix2f result) static org.lwjgl.util.vector.Matrix2fcreateSimpleRotateMatrix(float angle, org.lwjgl.util.vector.Matrix2f result) static org.lwjgl.util.vector.Matrix2fcreateSimpleRotateMatrix(org.lwjgl.util.vector.Vector2f vector, org.lwjgl.util.vector.Matrix2f result) static org.lwjgl.util.vector.Matrix2fcreateSimpleRotateMatrix(org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to, org.lwjgl.util.vector.Matrix2f result) static FloatBufferstatic FloatBuffercreateWindowCenterOrthoMatrix(boolean eraseAndWrite, FloatBuffer result) Use for directly write into buffer, and will not change the position of it.static FloatBuffercreateWindowCenterOrthoMatrix(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.Matrix4fcreateWindowCenterOrthoMatrix(org.lwjgl.util.vector.Matrix4f result) static FloatBufferstatic FloatBuffercreateWindowOrthoMatrix(boolean eraseAndWrite, FloatBuffer result) Use for directly write into buffer, and will not change the position of it.static FloatBuffercreateWindowOrthoMatrix(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.Matrix4fcreateWindowOrthoMatrix(org.lwjgl.util.vector.Matrix4f result) static org.lwjgl.util.vector.Vector2fgetRadiansRotateBase(float angRad, org.lwjgl.util.vector.Vector2f result) static org.lwjgl.util.vector.Vector2fgetRotateBase(float angle, org.lwjgl.util.vector.Vector2f result) static org.lwjgl.util.vector.Vector2fgetWorldLocationAtViewportUV(org.lwjgl.util.vector.Vector2f location, com.fs.starfarer.api.combat.ViewportAPI viewport) static org.lwjgl.util.vector.Vector2fgetWorldLocationAtViewportUV(org.lwjgl.util.vector.Vector2f location, com.fs.starfarer.api.combat.ViewportAPI viewport, org.lwjgl.util.vector.Vector2f result) static org.lwjgl.util.vector.Matrix2finverseRotate(org.lwjgl.util.vector.Matrix2f rotate) static org.lwjgl.util.vector.Matrix2finverseRotate(org.lwjgl.util.vector.Matrix2f rotate, org.lwjgl.util.vector.Matrix2f result) static FloatBufferinvertModelMatrix2D(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.Matrix4finvertModelMatrix2D(org.lwjgl.util.vector.Matrix4f src, org.lwjgl.util.vector.Matrix4f result) static FloatBufferinvertModelMatrix3D(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.Matrix4finvertModelMatrix3D(org.lwjgl.util.vector.Matrix4f src, org.lwjgl.util.vector.Matrix4f result) static org.lwjgl.util.vector.Matrix4fmakeStateMatrix(org.lwjgl.util.vector.Matrix4f result, org.lwjgl.util.vector.Matrix4f... matrices) Order is m1 * m2 * m3 ...static org.lwjgl.util.vector.Vector2fpointRadiansRotateTranslate(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.Vector2fpointRotateTranslate(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.Vector2fpointTranslateRadiansRotate(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.Vector2fpointTranslateRotate(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.QuaternionrotationFacingOnly(float yaw) z-axisstatic org.lwjgl.util.vector.QuaternionrotationFacingOnly(float yaw, org.lwjgl.util.vector.Quaternion result) z-axisstatic org.lwjgl.util.vector.QuaternionrotationXOnly(float pitch) static org.lwjgl.util.vector.QuaternionrotationXOnly(float pitch, org.lwjgl.util.vector.Quaternion result) static org.lwjgl.util.vector.QuaternionrotationYOnly(float roll) static org.lwjgl.util.vector.QuaternionrotationYOnly(float roll, org.lwjgl.util.vector.Quaternion result) static org.lwjgl.util.vector.QuaternionrotationZXY(float yaw, float pitch, float roll) ZXY order.static org.lwjgl.util.vector.QuaternionrotationZXY(float yaw, float pitch, float roll, org.lwjgl.util.vector.Quaternion result) ZXY order.static org.lwjgl.util.vector.QuaternionrotationZXY(org.lwjgl.util.vector.Vector3f rotate) static org.lwjgl.util.vector.QuaternionrotationZXY(org.lwjgl.util.vector.Vector3f rotate, org.lwjgl.util.vector.Quaternion result)
-
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 anglepitch- x's angleroll- y's angle
-
rotationZXY
public static org.lwjgl.util.vector.Quaternion rotationZXY(float yaw, float pitch, float roll) ZXY order.- Parameters:
yaw- z's anglepitch- x's angleroll- 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 thanMatrix4f.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 value1.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 value1.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 whenFloat.NaN.scale- hava default value{1.0f, 1.0f}if this parameter is null butfacingnot 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 whenFloat.NaN.scale- hava default value{1.0f, 1.0f}if this parameter is null butfacingnot 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 butrotatenot 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 butrotatenot 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
-
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
-
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
-
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 / heightresult- 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 / heightresult- 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
-