aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/math/Vec3f.java
diff options
context:
space:
mode:
authorSven Göthel <sgothel@jausoft.com>2024-01-26 01:18:21 +0100
committerSven Göthel <sgothel@jausoft.com>2024-01-26 01:18:21 +0100
commit09c256e2f26938cc2015176e259164bd7421dbdd (patch)
tree22e35811b481d4dd1e2688b4257fbb59af1b1831 /src/jogl/classes/com/jogamp/math/Vec3f.java
parent8fe39d3a524e5e580cf2667988965f1e27fed95b (diff)
Math Vec*: Rename {scale->mul}(..) for non-scalar types (n-dim); Add div(..)
Diffstat (limited to 'src/jogl/classes/com/jogamp/math/Vec3f.java')
-rw-r--r--src/jogl/classes/com/jogamp/math/Vec3f.java34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/jogl/classes/com/jogamp/math/Vec3f.java b/src/jogl/classes/com/jogamp/math/Vec3f.java
index 1ad27463e..2dc399ef1 100644
--- a/src/jogl/classes/com/jogamp/math/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/math/Vec3f.java
@@ -180,23 +180,39 @@ public final class Vec3f {
}
/** this = this * s, returns this. */
- public Vec3f scale(final float s) {
- x *= s;
- y *= s;
- z *= s;
- return this;
- }
+ public Vec3f mul(final Vec3f s) { return mul(s.x, s.y, s.z); }
/** this = this * { sx, sy, sz }, returns this. */
- public Vec3f scale(final float sx, final float sy, final float sz) {
+ public Vec3f mul(final float sx, final float sy, final float sz) {
x *= sx;
y *= sy;
z *= sz;
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); }
+ /** this = a / b, returns this. */
+ public Vec3f div(final Vec3f a, final Vec3f b) {
+ x = a.x / b.x;
+ y = a.y / b.y;
+ z = a.z / b.z;
+ return this;
+ }
+
+ /** this = this / a, returns this. */
+ public Vec3f div(final Vec3f a) {
+ x /= a.x;
+ y /= a.y;
+ z /= a.z;
+ return this;
+ }
+
+ /** this = this * s, returns this. */
+ public Vec3f scale(final float s) {
+ x *= s;
+ y *= s;
+ z *= s;
+ return this;
+ }
/** Returns this + arg; creates new vector */
public Vec3f plus(final Vec3f arg) {