@Test public void testToArray() { final double[] expected = new double[]{ 1d, 0d, 0d, 0d, 0d, 1d, 0d, 0d, 0d, 0d, 1d, 0d, 0d, 0d, 0d, 1d }; final double[] result = new double[16]; final Matrix4 m = new Matrix4(); m.toArray(result); assertNotNull(result); for (int i = 0; i < expected.length; ++i) { assertEquals(expected[i], result[i], 1e-14); } }
public void toArray(@NonNull @Size(min = 16) double[] doubleArray) { System.arraycopy(m, 0, doubleArray, 0, 16); }
Matrix4 implements Cloneable { public void toArray(@NonNull @Size(min = 16) double[] doubleArray) { System.arraycopy(m, 0, doubleArray, 0, 16); } }
Matrix4 implements Cloneable { public void toArray(@NonNull @Size(min = 16) double[] doubleArray) { System.arraycopy(m, 0, doubleArray, 0, 16); } Matrix4();  Matrix4(@NonNull Matrix4 matrix);  Matrix4(@NonNull @Size(min = 16) double[] matrix);  Matrix4(@NonNull @Size(min = 16) float[] matrix);  Matrix4(@NonNull Quaternion quat); }
Matrix4 implements Cloneable { public void toArray(@NonNull @Size(min = 16) double[] doubleArray) { System.arraycopy(m, 0, doubleArray, 0, 16); } Matrix4();  Matrix4(@NonNull Matrix4 matrix);  Matrix4(@NonNull @Size(min = 16) double[] matrix);  Matrix4(@NonNull @Size(min = 16) float[] matrix);  Matrix4(@NonNull Quaternion quat); @NonNull Matrix4 setAll(@NonNull Matrix4 matrix); @NonNull Matrix4 setAll(@NonNull @Size(min = 16) double[] matrix); @NonNull Matrix4 setAll(@NonNull @Size(min = 16) float[] matrix); @NonNull Matrix4 setAll(@NonNull Quaternion quat); @NonNull Matrix4 setAll(double w, double x, double y, double z); @NonNull Matrix4 setAll(@NonNull Vector3 xAxis, @NonNull Vector3 yAxis, @NonNull Vector3 zAxis, @NonNull Vector3 pos); @NonNull Matrix4 setAll(@NonNull Vector3 position, @NonNull Vector3 scale, @NonNull Quaternion rotation); @NonNull Matrix4 identity(); @NonNull Matrix4 zero(); double determinant(); @NonNull Matrix4 inverse(); @NonNull Matrix4 transpose(); @NonNull Matrix4 add(@NonNull Matrix4 matrix); @NonNull Matrix4 subtract(@NonNull Matrix4 matrix); @NonNull Matrix4 multiply(@NonNull Matrix4 matrix); @NonNull Matrix4 leftMultiply(@NonNull Matrix4 matrix); @NonNull Matrix4 multiply(double value); @NonNull Matrix4 translate(@NonNull Vector3 vec); @NonNull Matrix4 translate(double x, double y, double z); @NonNull Matrix4 negTranslate(@NonNull Vector3 vec); @NonNull Matrix4 scale(@NonNull Vector3 vec); @NonNull Matrix4 scale(double x, double y, double z); @NonNull Matrix4 scale(double s); @NonNull Matrix4 rotate(@NonNull Quaternion quat); @NonNull Matrix4 rotate(@NonNull Vector3 axis, double angle); @NonNull Matrix4 rotate(@NonNull Axis axis, double angle); @NonNull Matrix4 rotate(double x, double y, double z, double angle); @NonNull Matrix4 rotate(@NonNull Vector3 v1, @NonNull Vector3 v2); @NonNull Matrix4 setTranslation(@NonNull Vector3 vec); @NonNull Matrix4 setCoordinateZoom(double zoom); void rotateVector(@NonNull Vector3 vec); @NonNull Vector3 projectVector(@NonNull Vector3 vec); @NonNull Vector3 projectAndCreateVector(@NonNull Vector3 vec); @NonNull Matrix4 setTranslation(double x, double y, double z); @NonNull Matrix4 lerp(@NonNull Matrix4 matrix, double t); @NonNull Matrix4 setToNormalMatrix(); @NonNull Matrix4 setToPerspective(double near, double far, double fov, double aspect); @NonNull Matrix4 setToOrthographic2D(double x, double y, double width, double height); @NonNull Matrix4 setToOrthographic2D(double x, double y, double width, double height, double near, double far); @NonNull Matrix4 setToOrthographic(double left, double right, double bottom, double top, double near, double far); @NonNull Matrix4 setToTranslation(@NonNull Vector3 vec); @NonNull Matrix4 setToTranslation(double x, double y, double z); @NonNull Matrix4 setToScale(@NonNull Vector3 vec); @NonNull Matrix4 setToScale(double x, double y, double z); @NonNull Matrix4 setToTranslationAndScaling(@NonNull Vector3 translation, @NonNull Vector3 scaling); @NonNull Matrix4 setToTranslationAndScaling(double tx, double ty, double tz, double sx, double sy, double sz); @NonNull Matrix4 setToRotation(@NonNull Vector3 axis, double angle); @NonNull Matrix4 setToRotation(@NonNull Axis axis, double angle); @NonNull Matrix4 setToRotation(double x, double y, double z, double angle); @NonNull Matrix4 setToRotation(@NonNull Vector3 v1, @NonNull Vector3 v2); @NonNull Matrix4 setToRotation(double x1, double y1, double z1, double x2, double y2, double z2); @NonNull Matrix4 setToRotation(double yaw, double pitch, double roll); @NonNull Matrix4 setToLookAt(@NonNull Vector3 direction, @NonNull Vector3 up); @NonNull Matrix4 setToLookAt(@NonNull Vector3 position, @NonNull Vector3 target, @NonNull Vector3 up); @NonNull Matrix4 setToWorld(@NonNull Vector3 position, @NonNull Vector3 forward, @NonNull Vector3 up); @NonNull Vector3 getTranslation(); @NonNull Vector3 getTranslation(Vector3 vec); @NonNull Vector3 getScaling(); @NonNull Vector3 getScaling(@NonNull Vector3 vec); @NonNull static Matrix4 createRotationMatrix(@NonNull Quaternion quat); @NonNull static Matrix4 createRotationMatrix(@NonNull Vector3 axis, double angle); @NonNull static Matrix4 createRotationMatrix(@NonNull Axis axis, double angle); @NonNull static Matrix4 createRotationMatrix(double x, double y, double z, double angle); @NonNull static Matrix4 createRotationMatrix(double yaw, double pitch, double roll); @NonNull static Matrix4 createTranslationMatrix(@NonNull Vector3 vec); @NonNull static Matrix4 createTranslationMatrix(double x, double y, double z); @NonNull static Matrix4 createScaleMatrix(@NonNull Vector3 vec); @NonNull static Matrix4 createScaleMatrix(double x, double y, double z); @NonNull @Size(16) float[] getFloatValues(); @NonNull @Size(16) double[] getDoubleValues(); @NonNull @Override Matrix4 clone(); void toArray(@NonNull @Size(min = 16) double[] doubleArray); void toFloatArray(@NonNull @Size(min = 16) float[] floatArray); @Override boolean equals(Object o); @Override int hashCode(); @NonNull @Override String toString(); }
Matrix4 implements Cloneable { public void toArray(@NonNull @Size(min = 16) double[] doubleArray) { System.arraycopy(m, 0, doubleArray, 0, 16); } Matrix4();  Matrix4(@NonNull Matrix4 matrix);  Matrix4(@NonNull @Size(min = 16) double[] matrix);  Matrix4(@NonNull @Size(min = 16) float[] matrix);  Matrix4(@NonNull Quaternion quat); @NonNull Matrix4 setAll(@NonNull Matrix4 matrix); @NonNull Matrix4 setAll(@NonNull @Size(min = 16) double[] matrix); @NonNull Matrix4 setAll(@NonNull @Size(min = 16) float[] matrix); @NonNull Matrix4 setAll(@NonNull Quaternion quat); @NonNull Matrix4 setAll(double w, double x, double y, double z); @NonNull Matrix4 setAll(@NonNull Vector3 xAxis, @NonNull Vector3 yAxis, @NonNull Vector3 zAxis, @NonNull Vector3 pos); @NonNull Matrix4 setAll(@NonNull Vector3 position, @NonNull Vector3 scale, @NonNull Quaternion rotation); @NonNull Matrix4 identity(); @NonNull Matrix4 zero(); double determinant(); @NonNull Matrix4 inverse(); @NonNull Matrix4 transpose(); @NonNull Matrix4 add(@NonNull Matrix4 matrix); @NonNull Matrix4 subtract(@NonNull Matrix4 matrix); @NonNull Matrix4 multiply(@NonNull Matrix4 matrix); @NonNull Matrix4 leftMultiply(@NonNull Matrix4 matrix); @NonNull Matrix4 multiply(double value); @NonNull Matrix4 translate(@NonNull Vector3 vec); @NonNull Matrix4 translate(double x, double y, double z); @NonNull Matrix4 negTranslate(@NonNull Vector3 vec); @NonNull Matrix4 scale(@NonNull Vector3 vec); @NonNull Matrix4 scale(double x, double y, double z); @NonNull Matrix4 scale(double s); @NonNull Matrix4 rotate(@NonNull Quaternion quat); @NonNull Matrix4 rotate(@NonNull Vector3 axis, double angle); @NonNull Matrix4 rotate(@NonNull Axis axis, double angle); @NonNull Matrix4 rotate(double x, double y, double z, double angle); @NonNull Matrix4 rotate(@NonNull Vector3 v1, @NonNull Vector3 v2); @NonNull Matrix4 setTranslation(@NonNull Vector3 vec); @NonNull Matrix4 setCoordinateZoom(double zoom); void rotateVector(@NonNull Vector3 vec); @NonNull Vector3 projectVector(@NonNull Vector3 vec); @NonNull Vector3 projectAndCreateVector(@NonNull Vector3 vec); @NonNull Matrix4 setTranslation(double x, double y, double z); @NonNull Matrix4 lerp(@NonNull Matrix4 matrix, double t); @NonNull Matrix4 setToNormalMatrix(); @NonNull Matrix4 setToPerspective(double near, double far, double fov, double aspect); @NonNull Matrix4 setToOrthographic2D(double x, double y, double width, double height); @NonNull Matrix4 setToOrthographic2D(double x, double y, double width, double height, double near, double far); @NonNull Matrix4 setToOrthographic(double left, double right, double bottom, double top, double near, double far); @NonNull Matrix4 setToTranslation(@NonNull Vector3 vec); @NonNull Matrix4 setToTranslation(double x, double y, double z); @NonNull Matrix4 setToScale(@NonNull Vector3 vec); @NonNull Matrix4 setToScale(double x, double y, double z); @NonNull Matrix4 setToTranslationAndScaling(@NonNull Vector3 translation, @NonNull Vector3 scaling); @NonNull Matrix4 setToTranslationAndScaling(double tx, double ty, double tz, double sx, double sy, double sz); @NonNull Matrix4 setToRotation(@NonNull Vector3 axis, double angle); @NonNull Matrix4 setToRotation(@NonNull Axis axis, double angle); @NonNull Matrix4 setToRotation(double x, double y, double z, double angle); @NonNull Matrix4 setToRotation(@NonNull Vector3 v1, @NonNull Vector3 v2); @NonNull Matrix4 setToRotation(double x1, double y1, double z1, double x2, double y2, double z2); @NonNull Matrix4 setToRotation(double yaw, double pitch, double roll); @NonNull Matrix4 setToLookAt(@NonNull Vector3 direction, @NonNull Vector3 up); @NonNull Matrix4 setToLookAt(@NonNull Vector3 position, @NonNull Vector3 target, @NonNull Vector3 up); @NonNull Matrix4 setToWorld(@NonNull Vector3 position, @NonNull Vector3 forward, @NonNull Vector3 up); @NonNull Vector3 getTranslation(); @NonNull Vector3 getTranslation(Vector3 vec); @NonNull Vector3 getScaling(); @NonNull Vector3 getScaling(@NonNull Vector3 vec); @NonNull static Matrix4 createRotationMatrix(@NonNull Quaternion quat); @NonNull static Matrix4 createRotationMatrix(@NonNull Vector3 axis, double angle); @NonNull static Matrix4 createRotationMatrix(@NonNull Axis axis, double angle); @NonNull static Matrix4 createRotationMatrix(double x, double y, double z, double angle); @NonNull static Matrix4 createRotationMatrix(double yaw, double pitch, double roll); @NonNull static Matrix4 createTranslationMatrix(@NonNull Vector3 vec); @NonNull static Matrix4 createTranslationMatrix(double x, double y, double z); @NonNull static Matrix4 createScaleMatrix(@NonNull Vector3 vec); @NonNull static Matrix4 createScaleMatrix(double x, double y, double z); @NonNull @Size(16) float[] getFloatValues(); @NonNull @Size(16) double[] getDoubleValues(); @NonNull @Override Matrix4 clone(); void toArray(@NonNull @Size(min = 16) double[] doubleArray); void toFloatArray(@NonNull @Size(min = 16) float[] floatArray); @Override boolean equals(Object o); @Override int hashCode(); @NonNull @Override String toString(); static final int M00; static final int M01; static final int M02; static final int M03; static final int M10; static final int M11; static final int M12; static final int M13; static final int M20; static final int M21; static final int M22; static final int M23; static final int M30; static final int M31; static final int M32; static final int M33; }