aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-23 05:45:55 +0200
committerSven Gothel <[email protected]>2023-08-23 05:45:55 +0200
commitca49bcc03029156e52dfc29f886501548e9bf397 (patch)
tree69683761e9f9f50f1149357e72e9f2be473f2bba
parent64f7f17dc2db744106f1c71b576ef8e29a8854bd (diff)
Vec[234]f: Add scale(Vec[234]f s) variant for convenience
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Vec2f.java3
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Vec3f.java3
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Vec4f.java3
3 files changed, 9 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 47d1a78dc..d733aca5d 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vec2f.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vec2f.java
@@ -160,6 +160,9 @@ public final class Vec2f {
return this;
}
+ /** this = this * { s.x, s.y }, returns this. */
+ public Vec2f scale(final Vec2f s) { return scale(s.x, s.y); }
+
/** Returns this + arg; creates new vector */
public Vec2f plus(final Vec2f arg) {
return new Vec2f(this).add(arg);
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java b/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
index eb1144c07..f1f7cdca4 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
@@ -193,6 +193,9 @@ public final class Vec3f {
return this;
}
+ /** this = this * { s.x, s.y, s.z }, returns this. */
+ public Vec3f scale(final Vec3f s) { return scale(s.x, s.y, s.z); }
+
/** Returns this + arg; creates new vector */
public Vec3f plus(final Vec3f arg) {
return new Vec3f(this).add(arg);
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java b/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java
index f86fe5dad..a5276c7f1 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vec4f.java
@@ -189,6 +189,9 @@ public final class Vec4f {
return this;
}
+ /** this = this * { s.x, s.y, s.z, s.w }, returns this. */
+ public Vec4f scale(final Vec4f s) { return scale(s.x, s.y, s.z, s.w); }
+
/** Returns this + arg; creates new vector */
public Vec4f plus(final Vec4f arg) {
return new Vec4f(this).add(arg);