@@ -27,11 +27,13 @@ module.exports = class Vector3 {
/**
* Flip the sign of all properties of the vector
*
- * @returns {void}
+ * @returns {Vector3} A new Vector3
*/
negate() {
- this.x = -this.x;
- this.y = -this.y;
- this.z = -this.z;
+ return new Vector3(
+ -this.x,
+ -this.y,
+ -this.z,
+ );
}
};