mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Added Vector.equals methods.
This commit is contained in:
parent
a89c6a872a
commit
3d09a834b7
3 changed files with 16 additions and 1 deletions
|
@ -50,8 +50,13 @@ var Vector2 = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
angle: function () {
|
||||
equals: function (v)
|
||||
{
|
||||
return ((this.x === v.x) && (this.y === v.y));
|
||||
},
|
||||
|
||||
angle: function ()
|
||||
{
|
||||
// computes the angle in radians with respect to the positive x-axis
|
||||
|
||||
var angle = Math.atan2(this.y, this.x);
|
||||
|
|
|
@ -44,6 +44,11 @@ var Vector3 = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
equals: function (v)
|
||||
{
|
||||
return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z));
|
||||
},
|
||||
|
||||
copy: function (src)
|
||||
{
|
||||
this.x = src.x;
|
||||
|
|
|
@ -40,6 +40,11 @@ var Vector4 = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
equals: function (v)
|
||||
{
|
||||
return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w));
|
||||
},
|
||||
|
||||
set: function (x, y, z, w)
|
||||
{
|
||||
if (typeof x === 'object')
|
||||
|
|
Loading…
Reference in a new issue