From b7ef5e6fac72e0ed1c19eae27801c14772c2ba46 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 28 Apr 2023 11:18:01 +0200 Subject: AABBox: Add 'translate' w/ dedicated components --- src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java') 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 f76ae8059..531ea99ec 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java +++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java @@ -643,6 +643,21 @@ public class AABBox { return this; } + /** + * Translate this AABBox by a float[3] vector + * @param dx the translation x-component + * @param dy the translation y-component + * @param dz the translation z-component + * @param t the float[3] translation vector + * @return this AABBox for chaining + */ + public final AABBox translate(final float dx, final float dy, final float dz) { + low.add(dx, dy, dz); + high.add(dx, dy, dz); + computeCenter(); + return this; + } + /** * Translate this AABBox by a float[3] vector * @param t the float[3] translation vector -- cgit v1.2.3