Both Curve and Path now expose getStartPoint and getEndPoint

This commit is contained in:
Richard Davey 2017-09-26 17:01:22 +01:00
parent 34eaadfd00
commit bd1154c7bf
2 changed files with 22 additions and 0 deletions

View file

@ -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(); }

View file

@ -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)