From 6028c42d0ddb79293ec58a7ab95fdbebcb48db9b Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 22 Dec 2021 00:40:22 +0100 Subject: [PATCH] [DEBUG] correct min-max --- src/org/atriasoft/etk/Uri.java | 4 +++- src/org/atriasoft/etk/math/Vector2f.java | 6 +++--- src/org/atriasoft/etk/math/Vector3f.java | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/org/atriasoft/etk/Uri.java b/src/org/atriasoft/etk/Uri.java index 1d93292..ce1f76b 100644 --- a/src/org/atriasoft/etk/Uri.java +++ b/src/org/atriasoft/etk/Uri.java @@ -251,7 +251,7 @@ public class Uri { return new Uri(group, path, lib); } - public static void writeAll(final Uri uri, final String data) { + public static void writeAll(final Uri uri, final String data) throws IOException { BufferedWriter out = null; try { FileWriter fstream = new FileWriter(uri.getPath(), false); //true tells to append data. @@ -259,6 +259,7 @@ public class Uri { out.write(data); } catch (IOException e) { Log.error("Error: " + e.getMessage()); + throw e; } finally { if (out != null) { try { @@ -266,6 +267,7 @@ public class Uri { } catch (IOException e) { // TODO Auto-generated catch block Log.error("Error: ", e); + throw e; } } } diff --git a/src/org/atriasoft/etk/math/Vector2f.java b/src/org/atriasoft/etk/math/Vector2f.java index eb3a35b..0181f0d 100644 --- a/src/org/atriasoft/etk/math/Vector2f.java +++ b/src/org/atriasoft/etk/math/Vector2f.java @@ -36,7 +36,7 @@ public record Vector2f( /* * **************************************************** Constructor *****************************************************/ - + @CheckReturnValue public static Vector2f clipInt(final Vector2f obj1) { return new Vector2f((int) obj1.x, (int) obj1.y); @@ -379,7 +379,7 @@ public record Vector2f( /** * Set each element to the min of the current values and the values of * another vector - * @param other The other vector to compare with + * @param other The other vector to compare with */ @CheckReturnValue public Vector2f min(final Vector2f other) { @@ -396,7 +396,7 @@ public record Vector2f( * Set 0 value on all the vector */ public static final Vector2f MAX_VALUE = new Vector2f(Float.MAX_VALUE, Float.MAX_VALUE); - public static final Vector2f MIN_VALUE = new Vector2f(Float.MIN_VALUE, Float.MIN_VALUE); + public static final Vector2f MIN_VALUE = new Vector2f(-Float.MAX_VALUE, -Float.MAX_VALUE); public static final Vector2f ZERO = new Vector2f(0, 0); public static final Vector2f ONE = new Vector2f(1, 1); public static final Vector2f VALUE_2 = new Vector2f(2, 2); diff --git a/src/org/atriasoft/etk/math/Vector3f.java b/src/org/atriasoft/etk/math/Vector3f.java index 9b08445..77df3ab 100644 --- a/src/org/atriasoft/etk/math/Vector3f.java +++ b/src/org/atriasoft/etk/math/Vector3f.java @@ -556,6 +556,8 @@ public record Vector3f( */ public static final Vector3f ZERO = new Vector3f(0, 0, 0); public static final Vector3f ONE = new Vector3f(1, 1, 1); + public static final Vector3f MAX = new Vector3f(Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE); + public static final Vector3f MIN = new Vector3f(-Float.MAX_VALUE, -Float.MAX_VALUE, -Float.MAX_VALUE); public static final Vector3f VALUE_2 = new Vector3f(2, 2, 2); public static final Vector3f VALUE_4 = new Vector3f(4, 4, 4); public static final Vector3f VALUE_8 = new Vector3f(8, 8, 8);