From ca846bc67e6a074a182e97f29b3c34b90a12cac3 Mon Sep 17 00:00:00 2001 From: Sven Göthel <sgothel@jausoft.com> Date: Thu, 1 Feb 2024 13:46:27 +0100 Subject: Vec[234][ifd]: Add toArray(..) method --- src/jogl/classes/com/jogamp/math/Vec4f.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/jogl/classes/com/jogamp/math/Vec4f.java') diff --git a/src/jogl/classes/com/jogamp/math/Vec4f.java b/src/jogl/classes/com/jogamp/math/Vec4f.java index 5b17d7a4c..c2d0ccd3d 100644 --- a/src/jogl/classes/com/jogamp/math/Vec4f.java +++ b/src/jogl/classes/com/jogamp/math/Vec4f.java @@ -99,6 +99,15 @@ public final class Vec4f { return this; } + /** xyzw[0..3] = this.{x, y, z, w}, returns this. */ + public Vec4f toArray(final float[/*4*/] xyzw) { + xyzw[0] = this.x; + xyzw[1] = this.y; + xyzw[2] = this.z; + xyzw[3] = this.w; + return this; + } + /** Sets the ith component, 0 <= i < 4 */ public void set(final int i, final float val) { switch (i) { -- cgit v1.2.3