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