mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-18 06:13:55 -07:00
Fixes #5376, refs #2394. Differential Revision: https://code.wildfiregames.com/D1991 Patch By: Krinkle Comments By: Vladislav, wraitii This was SVN commit r22487.
41 lines
515 B
JavaScript
41 lines
515 B
JavaScript
function GlobalSubtractionHelper(a, b)
|
|
{
|
|
return a-b;
|
|
}
|
|
|
|
function Vector2D(x, y)
|
|
{
|
|
if (arguments.length == 2)
|
|
{
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
else
|
|
this.x = this.y = 0;
|
|
}
|
|
|
|
Vector2D.prototype.add = function(v)
|
|
{
|
|
this.x += v.x;
|
|
this.y += v.y;
|
|
return this;
|
|
};
|
|
|
|
function Vector3D(x, y, z)
|
|
{
|
|
if (arguments.length == 3)
|
|
{
|
|
this.x = x;
|
|
this.y = y;
|
|
this.z = z;
|
|
}
|
|
else
|
|
this.x = this.y = this.z = 0;
|
|
}
|
|
Vector3D.prototype.add = function(v)
|
|
{
|
|
this.x += v.x;
|
|
this.y += v.y;
|
|
this.z += v.z;
|
|
return this;
|
|
};
|