|
@@ -295,6 +295,13 @@
|
|
return new Vector2(this.x + otherVector.x, this.y + otherVector.y);
|
|
return new Vector2(this.x + otherVector.x, this.y + otherVector.y);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public addInPlace(otherVector: Vector2): Vector2 {
|
|
|
|
+ this.x += otherVector.x;
|
|
|
|
+ this.y += otherVector.y;
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
public subtract(otherVector: Vector2): Vector2 {
|
|
public subtract(otherVector: Vector2): Vector2 {
|
|
return new Vector2(this.x - otherVector.x, this.y - otherVector.y);
|
|
return new Vector2(this.x - otherVector.x, this.y - otherVector.y);
|
|
}
|
|
}
|
|
@@ -339,6 +346,10 @@
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public divideByFloats(x: number, y: number): Vector2 {
|
|
|
|
+ return new Vector2(this.x / x, this.y / y);
|
|
|
|
+ }
|
|
|
|
+
|
|
public negate(): Vector2 {
|
|
public negate(): Vector2 {
|
|
return new Vector2(-this.x, -this.y);
|
|
return new Vector2(-this.x, -this.y);
|
|
}
|
|
}
|
|
@@ -559,6 +570,18 @@
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public addFromFloats(x: number, y: number, z: number): Vector3 {
|
|
|
|
+ return new Vector3(this.x + x, this.y + y, this.z + z);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public addFromFloatsToRef(x: number, y: number, z: number, result: Vector3): Vector3 {
|
|
|
|
+ result.x = this.x + x;
|
|
|
|
+ result.y = this.y + y;
|
|
|
|
+ result.z = this.z + z;
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
public subtractInPlace(otherVector: Vector3): Vector3 {
|
|
public subtractInPlace(otherVector: Vector3): Vector3 {
|
|
this.x -= otherVector.x;
|
|
this.x -= otherVector.x;
|
|
this.y -= otherVector.y;
|
|
this.y -= otherVector.y;
|
|
@@ -660,6 +683,10 @@
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public divideByFloats(x: number, y: number, z: number): Vector3 {
|
|
|
|
+ return new Vector3(this.x / x, this.y / y, this.z / z);
|
|
|
|
+ }
|
|
|
|
+
|
|
public MinimizeInPlace(other: Vector3): Vector3 {
|
|
public MinimizeInPlace(other: Vector3): Vector3 {
|
|
if (other.x < this.x) this.x = other.x;
|
|
if (other.x < this.x) this.x = other.x;
|
|
if (other.y < this.y) this.y = other.y;
|
|
if (other.y < this.y) this.y = other.y;
|
|
@@ -1170,6 +1197,19 @@
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public addFromFloats(x: number, y: number, z: number, w: number): Vector4 {
|
|
|
|
+ return new Vector4(this.x + x, this.y + y, this.z + z, this.w + w);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public addFromFloatsToRef(x: number, y: number, z: number, w: number, result: Vector4): Vector4 {
|
|
|
|
+ result.x = this.x + x;
|
|
|
|
+ result.y = this.y + y;
|
|
|
|
+ result.z = this.z + z;
|
|
|
|
+ result.w = this.w + w;
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
public subtractInPlace(otherVector: Vector4): Vector4 {
|
|
public subtractInPlace(otherVector: Vector4): Vector4 {
|
|
this.x -= otherVector.x;
|
|
this.x -= otherVector.x;
|
|
this.y -= otherVector.y;
|
|
this.y -= otherVector.y;
|
|
@@ -1283,6 +1323,10 @@
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public divideByFloats(x: number, y: number, z: number, w: number): Vector4 {
|
|
|
|
+ return new Vector4(this.x / x, this.y / y, this.z / z, this.w / w);
|
|
|
|
+ }
|
|
|
|
+
|
|
public MinimizeInPlace(other: Vector4): Vector4 {
|
|
public MinimizeInPlace(other: Vector4): Vector4 {
|
|
if (other.x < this.x) this.x = other.x;
|
|
if (other.x < this.x) this.x = other.x;
|
|
if (other.y < this.y) this.y = other.y;
|
|
if (other.y < this.y) this.y = other.y;
|
|
@@ -3699,4 +3743,4 @@
|
|
SIMDHelper._isEnabled = true;
|
|
SIMDHelper._isEnabled = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|