Class Mat4f
java.lang.Object
com.seibel.distanthorizons.coreapi.util.math.Mat4f
An (almost) exact copy of Minecraft's 1.16.5
implementation of a 4x4 float matrix.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfloatadjudicate and determinatebooleancopy()org.joml.Matrix4fstatic Mat4fcreateScaleMatrix(float x, float y, float z) static Mat4fcreateTranslateMatrix(float x, float y, float z) booleanfloat[]Returns the values of this matrix in row major order (AKA rows then columns)inthashCode()voidinvert()voidmultiply(float scalar) voidvoidmultiplyBackward(Mat4f other) voidmultiplyTranslationMatrix(double x, double y, double z) originally "translate" from Minecraft's MatrixStackstatic Mat4fperspective(double fov, float widthHeightRatio, float nearClipPlane, float farClipPlane) voidvoidsetClipPlanes(float nearClip, float farClip) Changes the values that store the clipping planes.voidvoidsetTranslation(float x, float y, float z) voidstore(FloatBuffer floatBuffer) toString()voidTODO: what kind of translation is this? and how is this different from "multiplyTranslationMatrix"? Answer: This is faster and direct (but only if this is pure translation matrix without rotate)void
-
Constructor Details
-
Mat4f
public Mat4f() -
Mat4f
-
Mat4f
public Mat4f(org.joml.Matrix4fc sourceMatrix) -
Mat4f
public Mat4f(float[] values) -
Mat4f
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
store
-
createJomlMatrix
public org.joml.Matrix4f createJomlMatrix() -
setIdentity
public void setIdentity() -
adjudicateAndDet
public float adjudicateAndDet()adjudicate and determinate -
transpose
public void transpose() -
canInvert
public boolean canInvert() -
invert
public void invert() -
multiply
-
multiply
public void multiply(float scalar) -
perspective
public static Mat4f perspective(double fov, float widthHeightRatio, float nearClipPlane, float farClipPlane) -
translate
TODO: what kind of translation is this? and how is this different from "multiplyTranslationMatrix"? Answer: This is faster and direct (but only if this is pure translation matrix without rotate) -
multiplyTranslationMatrix
public void multiplyTranslationMatrix(double x, double y, double z) originally "translate" from Minecraft's MatrixStack -
copy
-
createScaleMatrix
-
createTranslateMatrix
-
getValuesAsArray
public float[] getValuesAsArray()Returns the values of this matrix in row major order (AKA rows then columns) -
asNonNormalizedLookForwardVector
-
set
-
add
-
multiplyBackward
-
setTranslation
public void setTranslation(float x, float y, float z) -
setClipPlanes
public void setClipPlanes(float nearClip, float farClip) Changes the values that store the clipping planes. Formula for calculating matrix values is the same that OpenGL uses when making matrices.- Parameters:
nearClip- New near clipping plane value.farClip- New far clipping plane value.
-