diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/Vec4f.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/math/Vec4f.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java b/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java index 254566ae0..f86fe5dad 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java +++ b/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java @@ -140,6 +140,23 @@ public final class Vec4f { public void setZ(final float z) { this.z = z; } public void setW(final float w) { this.w = w; } + /** this = max(this, m), returns this. */ + public Vec4f max(final Vec4f 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); + this.w = Math.max(this.w, m.w); + return this; + } + /** this = min(this, m), returns this. */ + public Vec4f min(final Vec4f 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); + this.w = Math.min(this.w, m.w); + return this; + } + /** Returns this * val; creates new vector */ public Vec4f mul(final float val) { return new Vec4f(this).scale(val); |