aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/Vec3f.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Vec3f.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java b/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
index fbcd1e9a5..eb1144c07 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
@@ -149,6 +149,21 @@ public final class Vec3f {
public void setY(final float y) { this.y = y; }
public void setZ(final float z) { this.z = z; }
+ /** this = max(this, m), returns this. */
+ public Vec3f max(final Vec3f m) {
+ this.x = Math.max(this.x, m.x);
+ this.y = Math.max(this.y, m.y);
+ this.z = Math.max(this.z, m.z);
+ return this;
+ }
+ /** this = min(this, m), returns this. */
+ public Vec3f min(final Vec3f m) {
+ this.x = Math.min(this.x, m.x);
+ this.y = Math.min(this.y, m.y);
+ this.z = Math.min(this.z, m.z);
+ return this;
+ }
+
/** Returns this * val; creates new vector */
public Vec3f mul(final float val) {
return new Vec3f(this).scale(val);