java.lang.Object
org.spongepowered.math.matrix.Matrix4d
- All Implemented Interfaces:
Serializable
,Matrixd
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMatrix4d
(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33) Matrix4d
(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33) -
Method Summary
Modifier and TypeMethodDescriptionabs()
ceil()
column
(int col) static Matrix4d
createLookAt
(Vector3d eye, Vector3d at, Vector3d up) Creates a "look at" matrix for the given eye point.static Matrix4d
createOrthographic
(double right, double left, double top, double bottom, double near, double far) Creates an orthographic viewing frustum built from the provided valuesstatic Matrix4d
createOrthographic
(float right, float left, float top, float bottom, float near, float far) Creates an orthographic viewing frustum built from the provided valuesstatic Matrix4d
createPerspective
(double fov, double aspect, double near, double far) Creates a perspective projection matrix with the given (x) FOV, aspect, near and far planesstatic Matrix4d
createPerspective
(float fov, float aspect, float near, float far) Creates a perspective projection matrix with the given (x) FOV, aspect, near and far planesstatic Matrix4d
createRotation
(Complexd rot) static Matrix4d
static Matrix4d
createScaling
(double scale) static Matrix4d
createScaling
(double x, double y, double z, double w) static Matrix4d
createScaling
(float scale) static Matrix4d
createScaling
(float x, float y, float z, float w) static Matrix4d
static Matrix4d
createTranslation
(double x, double y, double z) static Matrix4d
createTranslation
(float x, float y, float z) static Matrix4d
double
div
(double a) div
(float a) boolean
floor()
static Matrix4d
from
(double n) static Matrix4d
from
(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33) static Matrix4d
fromDiagonal
(double m00, double m11, double m22, double m33) double
get
(int row, int col) int
hashCode()
invert()
mul
(double a) mul
(float a) negate()
pow
(double pow) pow
(float pow) rotate
(Quaterniond rot) round()
row
(int row) scale
(double scale) scale
(double x, double y, double z, double w) scale
(float scale) scale
(float x, float y, float z, float w) double[]
toArray()
double[]
toArray
(boolean columnMajor) toDouble()
toFloat()
toString()
double
trace()
transform
(double x, double y, double z, double w) transform
(float x, float y, float z, float w) translate
(double x, double y, double z) translate
(float x, float y, float z)
-
Field Details
-
ZERO
-
IDENTITY
-
-
Constructor Details
-
Matrix4d
-
Matrix4d
-
Matrix4d
-
Matrix4d
public Matrix4d(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33) -
Matrix4d
public Matrix4d(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33)
-
-
Method Details
-
get
public double get(int row, int col) -
row
-
column
-
add
-
sub
-
mul
-
mul
-
mul
-
div
-
div
-
div
-
pow
-
pow
-
translate
-
translate
-
translate
-
scale
-
scale
-
scale
-
scale
-
scale
-
rotate
-
rotate
-
transform
-
transform
-
transform
-
floor
-
ceil
-
round
-
abs
-
negate
-
transpose
-
trace
public double trace() -
determinant
public double determinant()- Specified by:
determinant
in interfaceMatrixd
-
invert
-
toMatrix2
-
toMatrix3
-
toMatrixN
-
toArray
public double[] toArray() -
toArray
public double[] toArray(boolean columnMajor) -
toFloat
-
toDouble
-
toString
-
equals
-
hashCode
public int hashCode() -
from
-
from
public static Matrix4d from(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33) -
fromDiagonal
-
createScaling
-
createScaling
-
createScaling
-
createScaling
-
createScaling
-
createTranslation
-
createTranslation
-
createTranslation
-
createRotation
-
createRotation
-
createLookAt
Creates a "look at" matrix for the given eye point.- Parameters:
eye
- The position of the cameraat
- The point that the camera is looking atup
- The "up" vector- Returns:
- A rotational transform that corresponds to a camera looking at the given point
-
createPerspective
Creates a perspective projection matrix with the given (x) FOV, aspect, near and far planes- Parameters:
fov
- The field of view in the x directionaspect
- The aspect ratio, usually width/heightnear
- The near plane, cannot be 0far
- the far plane, far cannot equal near- Returns:
- A perspective projection matrix built from the given values
-
createPerspective
Creates a perspective projection matrix with the given (x) FOV, aspect, near and far planes- Parameters:
fov
- The field of view in the x directionaspect
- The aspect ratio, usually width/heightnear
- The near plane, cannot be 0far
- the far plane, far cannot equal near- Returns:
- A perspective projection matrix built from the given values
-
createOrthographic
public static Matrix4d createOrthographic(float right, float left, float top, float bottom, float near, float far) Creates an orthographic viewing frustum built from the provided values- Parameters:
right
- the right most plane of the viewing frustumleft
- the left most plane of the viewing frustumtop
- the top plane of the viewing frustumbottom
- the bottom plane of the viewing frustumnear
- the near plane of the viewing frustumfar
- the far plane of the viewing frustum- Returns:
- A viewing frustum built from the provided values
-
createOrthographic
public static Matrix4d createOrthographic(double right, double left, double top, double bottom, double near, double far) Creates an orthographic viewing frustum built from the provided values- Parameters:
right
- the right most plane of the viewing frustumleft
- the left most plane of the viewing frustumtop
- the top plane of the viewing frustumbottom
- the bottom plane of the viewing frustumnear
- the near plane of the viewing frustumfar
- the far plane of the viewing frustum- Returns:
- A viewing frustum built from the provided values
-