mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Both Curve and Path now expose getStartPoint and getEndPoint
This commit is contained in:
parent
34eaadfd00
commit
bd1154c7bf
2 changed files with 22 additions and 0 deletions
|
@ -111,6 +111,13 @@ var Path = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
getStartPoint: function (out)
|
||||
{
|
||||
if (out === undefined) { out = new Vector2(); }
|
||||
|
||||
return out.copy(this.startPoint);
|
||||
},
|
||||
|
||||
getEndPoint: function (out)
|
||||
{
|
||||
if (out === undefined) { out = new Vector2(); }
|
||||
|
|
|
@ -25,7 +25,22 @@ var Curve = new Class({
|
|||
this.needsUpdate = true;
|
||||
},
|
||||
|
||||
getStartPoint: function (out)
|
||||
{
|
||||
if (out === undefined) { out = new Vector2(); }
|
||||
|
||||
return this.getPointAt(0, out);
|
||||
},
|
||||
|
||||
getEndPoint: function (out)
|
||||
{
|
||||
if (out === undefined) { out = new Vector2(); }
|
||||
|
||||
return this.getPointAt(1, out);
|
||||
},
|
||||
|
||||
// Get point at relative position in curve according to arc length
|
||||
|
||||
// - u [0 .. 1]
|
||||
|
||||
getPointAt: function (u, out)
|
||||
|
|
Loading…
Reference in a new issue