Skip to content

Commit 9fed75b

Browse files
committed
Add PVector.array() method
1 parent f3c6646 commit 9fed75b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Processing.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ class PVector {
304304
PVector& set(float _x, float _y, float _z=0) { x=_x; y=_y; z=_z; return *this; }
305305
PVector& set(const PVector& v) { x=v.x; y=v.y; z=v.z; return *this; }
306306
PVector copy() const { return PVector(x, y, z); }
307+
::std::vector<float> array() const { return {x, y, z}; }
307308

308309
// Magnitude
309310
float mag() const { return ::std::sqrt(x*x + y*y + z*z); }

0 commit comments

Comments
 (0)