Class Matrix4Utils
java.lang.Object
gaiasky.util.math.Matrix4Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidget(com.badlogic.gdx.math.Matrix4 m, int offset, FloatBuffer src) static voidput(com.badlogic.gdx.math.Matrix4 m, FloatBuffer buffer) static float[]recoverEulerAngles(com.badlogic.gdx.math.Matrix4 m) Recovers the Euler angles (yaw, pitch, and roll) from the given 4x4 transformation matrix, in degrees.static voidsetScaling(com.badlogic.gdx.math.Matrix4 m, float scl) static voidsetScaling(com.badlogic.gdx.math.Matrix4 m, com.badlogic.gdx.math.Vector3 scl)
-
Constructor Details
-
Matrix4Utils
public Matrix4Utils()
-
-
Method Details
-
setScaling
public static void setScaling(com.badlogic.gdx.math.Matrix4 m, float scl) -
setScaling
public static void setScaling(com.badlogic.gdx.math.Matrix4 m, com.badlogic.gdx.math.Vector3 scl) -
recoverEulerAngles
public static float[] recoverEulerAngles(com.badlogic.gdx.math.Matrix4 m) Recovers the Euler angles (yaw, pitch, and roll) from the given 4x4 transformation matrix, in degrees.This method extracts the yaw, pitch, and roll values from a matrix representing a 3D rotation. The angles are calculated based on the matrix elements. The result is a 3-element array where:
- Element 0 is the yaw angle (rotation around the Y-axis),
- Element 1 is the pitch angle (rotation around the X-axis),
- Element 2 is the roll angle (rotation around the Z-axis).
In the case of gimbal lock (when the cosine of the pitch is zero), yaw is set to 0 and roll is computed from the matrix elements.
- Parameters:
m- the 4x4 transformation matrix representing the rotation- Returns:
- an array of floats containing the Euler angles in the order: [yaw, pitch, roll]
-
put
-
get
-