diff --git a/src/math/Vector2.js b/src/math/Vector2.js index 8000533a7c1f3..f415209e83547 100644 --- a/src/math/Vector2.js +++ b/src/math/Vector2.js @@ -434,6 +434,12 @@ class Vector2 { } + toJSON() { + + return { x: this.x, y: this.y }; + + } + fromBufferAttribute( attribute, index, offset ) { if ( offset !== undefined ) { diff --git a/src/math/Vector3.js b/src/math/Vector3.js index 8ab45747d6d8d..1ff08f472a2bb 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -696,6 +696,12 @@ class Vector3 { } + toJSON() { + + return { x: this.x, y: this.y, z: this.z }; + + } + fromBufferAttribute( attribute, index, offset ) { if ( offset !== undefined ) { diff --git a/src/math/Vector4.js b/src/math/Vector4.js index d2edcf22df7db..c893b3cc1a73a 100644 --- a/src/math/Vector4.js +++ b/src/math/Vector4.js @@ -622,6 +622,12 @@ class Vector4 { } + toJSON() { + + return { x: this.x, y: this.y, z: this.z, w: this.w }; + + } + fromBufferAttribute( attribute, index, offset ) { if ( offset !== undefined ) {