aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/math/Vec2f.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/Vec2f.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Vec2f.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vec2f.java b/src/jogl/classes/com/jogamp/opengl/math/Vec2f.java
index 20628d949..47d1a78dc 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vec2f.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vec2f.java
@@ -121,6 +121,19 @@ public final class Vec2f {
public void setX(final float x) { this.x = x; }
public void setY(final float y) { this.y = y; }
+ /** this = max(this, m), returns this. */
+ public Vec2f max(final Vec2f m) {
+ this.x = Math.max(this.x, m.x);
+ this.y = Math.max(this.y, m.y);
+ return this;
+ }
+ /** this = min(this, m), returns this. */
+ public Vec2f min(final Vec2f m) {
+ this.x = Math.min(this.x, m.x);
+ this.y = Math.min(this.y, m.y);
+ return this;
+ }
+
/** Returns this * val; creates new vector */
public Vec2f mul(final float val) {
return new Vec2f(this).scale(val);