diff --git a/src/tracer/data/base/Matrix4.java b/src/tracer/data/base/Matrix4.java index 3c1f1f2..eee0a4b 100644 --- a/src/tracer/data/base/Matrix4.java +++ b/src/tracer/data/base/Matrix4.java @@ -584,7 +584,7 @@ public static Matrix4 mul(Matrix4 m1, Matrix4 m2) { */ public static Matrix4 compose(Matrix4... ms) { if (ms.length == 0) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("The compose method should receive at least one matrix."); } Matrix4 result = ms[0].copy(); for (int i = 1; i < ms.length; i++) { @@ -746,8 +746,9 @@ public static Matrix4 rotationAround(Vector3 axis, float angle) { /** * Returns the rotation between two vectors. + * * @param from the from direction vector - * @param to the to direction vector + * @param to the to direction vector * @return the rotation matrix */ public static Matrix4 rotationBetween(Vector3 from, Vector3 to) { @@ -755,7 +756,7 @@ public static Matrix4 rotationBetween(Vector3 from, Vector3 to) { return identity(); } Vector3 axis = Vector3.cross(from, to); - float angle = from.cos(to); + float angle = from.angle(to); return rotationAround(axis, angle); }