File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/main/java/com/github/stephengold/joltjni Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,17 @@ public boolean isNormalized(float tolerance) {
354354 }
355355 }
356356
357+ /**
358+ * Test whether the quaternion is zero. The quaternion is unaffected.
359+ *
360+ * @return {@code true} if exactly zero, otherwise {@code false}
361+ */
362+ @ Override
363+ public boolean isZero () {
364+ boolean result = (w == 0f ) && (x == 0f ) && (y == 0f ) && (z == 0f );
365+ return result ;
366+ }
367+
357368 /**
358369 * Return the length. The quaternion is unaffected.
359370 *
Original file line number Diff line number Diff line change 11/*
2- Copyright (c) 2024 Stephen Gold
2+ Copyright (c) 2024-2025 Stephen Gold
33
44Permission is hereby granted, free of charge, to any person obtaining a copy
55of this software and associated documentation files (the "Software"), to deal
@@ -90,6 +90,13 @@ public interface QuatArg {
9090 */
9191 boolean isNormalized (float tolerance );
9292
93+ /**
94+ * Test whether the quaternion is zero. The quaternion is unaffected.
95+ *
96+ * @return {@code true} if zero, otherwise {@code false}
97+ */
98+ boolean isZero ();
99+
93100 /**
94101 * Return the length. The quaternion is unaffected.
95102 *
You can’t perform that action at this time.
0 commit comments