diff options
author | Sven Gothel <[email protected]> | 2023-08-28 22:57:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-08-28 22:57:53 +0200 |
commit | 920e529516bb264f04138ed1caca80d4925e3773 (patch) | |
tree | 498bce9425f880cab2cd36b4251eaa4e231e912c /src/jogl/classes/com/jogamp/opengl/math/geom | |
parent | 733cc5272cfed10fa07b707e29fd756f44581508 (diff) |
Graph Font + Glyph: More robust detetection and API definition of non-contour/whitespace Glyphs (detect and allow to skip 'em)
We also drop shapes for both, but for id 0 (unknown).
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/geom')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java index 4e7dc308a..1720caf0e 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java +++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java @@ -784,6 +784,26 @@ public class AABBox { return high.z() - low.z(); } + /** Returns the volume, i.e. width * height * depth */ + public final float getVolume() { + return getWidth() * getHeight() * getDepth(); + } + + /** Return true if {@link #getVolume()} is {@link FloatUtil#isZero(float)}, considering epsilon. */ + public final boolean hasZeroVolume() { + return FloatUtil.isZero(getVolume()); + } + + /** Returns the assumed 2D area, i.e. width * height while assuming low and high lies on same plane. */ + public final float get2DArea() { + return getWidth() * getHeight(); + } + + /** Return true if {@link #get2DArea()} is {@link FloatUtil#isZero(float)}, considering epsilon. */ + public final boolean hasZero2DArea() { + return FloatUtil.isZero(get2DArea()); + } + @Override public final boolean equals(final Object obj) { if( obj == this ) { |