diff --git a/src/as/com/threerings/flash/Vector2.as b/src/as/com/threerings/flash/Vector2.as index 18d63976..199cd58e 100644 --- a/src/as/com/threerings/flash/Vector2.as +++ b/src/as/com/threerings/flash/Vector2.as @@ -44,6 +44,14 @@ public class Vector2 return new Vector2(p.x, p.y); } + /** + * Creates a new Vector2 pointing from s to t. + */ + public static function fromPoints (s :Point, t :Point) :Vector2 + { + return new Vector2(t.x - s.x, t.y - s.y); + } + /** * Creates a Vector2 of magnitude 'len' that has been rotated about the origin by 'radians'. */