diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java | 21 |
1 files changed, 20 insertions, 1 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 d54142e38..234b2121b 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java +++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java @@ -582,7 +582,10 @@ public class AABBox { } /** - * Scale this AABBox by a constant + * Scale this AABBox by a constant around fixed center + * <p> + * high and low is recomputed by scaling its distance to fixed center. + * </p> * @param size a constant float value * @param tmpV3 caller provided temporary 3-component vector * @return this AABBox for chaining @@ -605,6 +608,22 @@ public class AABBox { } /** + * Scale this AABBox by a constant, recomputing center + * <p> + * high and low is scaled and center recomputed. + * </p> + * @param size a constant float value + * @param tmpV3 caller provided temporary 3-component vector + * @return this AABBox for chaining + */ + public final AABBox scale2(final float size, final float[] tmpV3) { + VectorUtil.scaleVec3(high, high, size); // in-place scale + VectorUtil.scaleVec3(low, low, size); // in-place scale + computeCenter(); + return this; + } + + /** * Translate this AABBox by a float[3] vector * @param t the float[3] translation vector * @return this AABBox for chaining |