public class Matrix4x4
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
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 |
Constructor and Description |
---|
Matrix4x4()
Constructs a new 4x4 matrix, initialized as an identity matrix:
|
Matrix4x4(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)
Constructs a new 4x4 matrix using the 16 values specified
|
Matrix4x4(Matrix4x4 matrix)
Constructs a new 4x4 matrix, copying the 16 values from another matrix
|
Modifier and Type | Method and Description |
---|---|
Matrix4x4 |
clone() |
static Matrix4x4 |
computeProjectionMatrix(Vector3[] p) |
static Matrix4x4 |
fromColumns3x3(org.bukkit.util.Vector v0,
org.bukkit.util.Vector v1,
org.bukkit.util.Vector v2)
Creates a 4x4 matrix from 3 columns of a 3x3 matrix
|
Quaternion |
getRotation()
Gets the rotation transformation performed as a Quaternion
|
org.bukkit.util.Vector |
getYawPitchRoll()
Deduces the yaw/pitch/roll values in degrees that this matrix transforms objects with
|
boolean |
invert()
General invert routine.
|
void |
multiply(Matrix4x4 m1)
Multiplies this matrix with another, storing the result in this matrix
|
void |
rotate(Quaternion quat)
Multiplies this matrix with a rotation transformation defined in a Quaternion
|
void |
rotateX(double angle)
Multiplies this matrix with a rotation transformation about the X-axis
|
void |
rotateX(double y,
double z)
Multiplies this matrix with a rotation transformation about the X-axis.
|
void |
rotateY(double angle)
Multiplies this matrix with a rotation transformation about the Y-axis
|
void |
rotateY(double x,
double z)
Multiplies this matrix with a rotation transformation about the Y-axis.
|
void |
rotateYawPitchRoll(double pitch,
double yaw,
double roll)
Multiplies this matrix with a rotation transformation in yaw/pitch/roll, based on the Minecraft
coordinate system.
|
void |
rotateYawPitchRoll(float pitch,
float yaw,
float roll)
Multiplies this matrix with a rotation transformation in yaw/pitch/roll, based on the Minecraft
coordinate system.
|
void |
rotateYawPitchRoll(org.bukkit.util.Vector rotation)
Multiplies this matrix with a rotation transformation in yaw/pitch/roll, based on the Minecraft
coordinate system.
|
void |
rotateYawPitchRoll(Vector3 rotation)
Multiplies this matrix with a rotation transformation in yaw/pitch/roll, based on the Minecraft
coordinate system.
|
void |
rotateZ(double angle)
Multiplies this matrix with a rotation transformation about the Z-axis
|
void |
rotateZ(double x,
double y)
Multiplies this matrix with a rotation transformation about the Z-axis.
|
void |
scale(double scale)
Multiplies this matrix with a scale transformation
|
void |
scale(double sx,
double sy,
double sz)
Multiplies this matrix with a scale transformation
|
void |
scale(Vector3 scale)
Multiplies this matrix with a scale transformation
|
void |
set(double[] values)
Sets this matrix to all the values in an array
|
void |
set(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)
Sets all 16 values of this 4x4 matrix
|
void |
set(float[] values)
Sets this matrix to all the values in an array
|
void |
set(Matrix4x4 m)
Sets this matrix to all values of another 4x4 matrix
|
void |
setIdentity()
Sets this matrix to the identity matrix:
|
void |
toArray(double[] values)
Gets all 16 values from this 4x4 matrix and writes them to an array
|
void |
toArray(float[] values)
Gets all 16 values from this 4x4 matrix and writes them to an array
|
java.lang.String |
toString() |
org.bukkit.util.Vector |
toVector()
Obtains the absolute position vector of this matrix, equivalent to performing
transformPoint with a zero vector.
|
Vector3 |
toVector3()
Obtains the absolute position vector of this matrix, equivalent to performing
transformPoint with a zero vector.
|
void |
transformPoint(org.bukkit.util.Vector point)
Transforms a 3D point vector using this transformation matrix.
|
void |
transformPoint(Vector3 point)
Transforms a 3D point vector using this transformation matrix.
|
void |
transformPoint(Vector4 point)
Transforms a 4D point vector using this transformation matrix.
|
void |
transformQuad(Quad quad)
Transforms all four points of a quad using this transformation matrix.
|
void |
translate(double dx,
double dy,
double dz)
Multiplies this matrix with a translation transformation
|
void |
translate(org.bukkit.util.Vector translation)
Multiplies this matrix with a translation transformation.
|
void |
translate(Vector3 translation)
Multiplies this matrix with a translation transformation
|
void |
translateRotate(double x,
double y,
double z,
float pitch,
float yaw)
Translates and rotates this Matrix with position and rotation information
|
void |
translateRotate(double x,
double y,
double z,
float pitch,
float yaw,
float roll)
Translates and rotates this Matrix with position and rotation information
|
void |
translateRotate(org.bukkit.Location location)
Translates and rotates this Matrix with the position information of a Bukkit Location
|
public double m00
public double m01
public double m02
public double m03
public double m10
public double m11
public double m12
public double m13
public double m20
public double m21
public double m22
public double m23
public double m30
public double m31
public double m32
public double m33
public Matrix4x4()
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
public Matrix4x4(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)
public Matrix4x4(Matrix4x4 matrix)
matrix
- to set topublic final void set(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)
public final void set(Matrix4x4 m)
m
- matrix to set topublic final void setIdentity()
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
public final void set(float[] values)
values
- to set to (length 16 or less)public final void set(double[] values)
values
- array to read from (length 16 or more)public final void toArray(float[] values)
values
- array to write to (length 16 or more)public final void toArray(double[] values)
values
- array to write to (length 16 or more)public final boolean invert()
public final void rotate(Quaternion quat)
quat
- to rotate withpublic final void rotateX(double angle)
angle
- the angle to rotate about the X axis in degreespublic final void rotateX(double y, double z)
y
- z
- public final void rotateY(double angle)
angle
- the angle to rotate about the Y axis in degreespublic final void rotateY(double x, double z)
x
- z
- public final void rotateZ(double angle)
angle
- the angle to rotate about the Z axis in degreespublic final void rotateZ(double x, double y)
x
- y
- public final void rotateYawPitchRoll(Vector3 rotation)
rotation
- (x=pitch, y=yaw, z=roll)public final void rotateYawPitchRoll(org.bukkit.util.Vector rotation)
rotation
- (x=pitch, y=yaw, z=roll)public final void rotateYawPitchRoll(double pitch, double yaw, double roll)
pitch
- rotation (X)yaw
- rotation (Y)roll
- rotation (Z)public final void rotateYawPitchRoll(float pitch, float yaw, float roll)
pitch
- rotation (X)yaw
- rotation (Y)roll
- rotation (Z)public final Quaternion getRotation()
public final org.bukkit.util.Vector getYawPitchRoll()
public final void translate(Vector3 translation)
translation
- public final void translate(double dx, double dy, double dz)
dx
- translationdy
- translationdz
- translationpublic final void translate(org.bukkit.util.Vector translation)
translation
- public final void scale(Vector3 scale)
scale
- public final void scale(double sx, double sy, double sz)
sx
- scalesy
- scalesz
- scalepublic final void scale(double scale)
scale
- public final void translateRotate(org.bukkit.Location location)
location
- to translate and rotate bypublic final void translateRotate(double x, double y, double z, float pitch, float yaw)
x
- positiony
- positionz
- positionpitch
- rotation (X)yaw
- rotation (Y)public final void translateRotate(double x, double y, double z, float pitch, float yaw, float roll)
x
- positiony
- positionz
- positionpitch
- rotation (X)yaw
- rotation (Y)roll
- rotation (Z)public final void multiply(Matrix4x4 m1)
m1
- the other matrix to multiply withpublic final void transformPoint(org.bukkit.util.Vector point)
point
- to transformpublic final void transformPoint(Vector3 point)
point
- to transformpublic final void transformPoint(Vector4 point)
point
- to transformpublic final void transformQuad(Quad quad)
quad
- to transformpublic Vector3 toVector3()
public org.bukkit.util.Vector toVector()
public Matrix4x4 clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static Matrix4x4 fromColumns3x3(org.bukkit.util.Vector v0, org.bukkit.util.Vector v1, org.bukkit.util.Vector v2)
v0
- column 0v1
- column 1v2
- column 2