From 920e529516bb264f04138ed1caca80d4925e3773 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 28 Aug 2023 22:57:53 +0200 Subject: 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). --- .../classes/com/jogamp/opengl/math/geom/AABBox.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/jogl/classes/com/jogamp/opengl/math/geom') 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 ) { -- cgit v1.2.3