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) {
354
354
}
355
355
}
356
356
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
+
357
368
/**
358
369
* Return the length. The quaternion is unaffected.
359
370
*
Original file line number Diff line number Diff line change 1
1
/*
2
- Copyright (c) 2024 Stephen Gold
2
+ Copyright (c) 2024-2025 Stephen Gold
3
3
4
4
Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
of this software and associated documentation files (the "Software"), to deal
@@ -90,6 +90,13 @@ public interface QuatArg {
90
90
*/
91
91
boolean isNormalized (float tolerance );
92
92
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
+
93
100
/**
94
101
* Return the length. The quaternion is unaffected.
95
102
*
You can’t perform that action at this time.
0 commit comments