From f92b29a4a3eabfc635098267e289ae09b1edaf0b Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sun, 13 Jul 2014 17:25:17 -0700 Subject: [PATCH] Added rotate to Vector APIs. --- app/lib/world/vector.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/world/vector.coffee b/app/lib/world/vector.coffee index a17e5d077..712d99d64 100644 --- a/app/lib/world/vector.coffee +++ b/app/lib/world/vector.coffee @@ -2,13 +2,13 @@ class Vector @className: 'Vector' # Class methods for nondestructively operating - for name in ['add', 'subtract', 'multiply', 'divide', 'limit', 'normalize'] + for name in ['add', 'subtract', 'multiply', 'divide', 'limit', 'normalize', 'rotate'] do (name) -> Vector[name] = (a, b, useZ) -> a.copy()[name](b, useZ) isVector: true - apiProperties: ['x', 'y', 'z', 'magnitude', 'heading', 'distance', 'dot', 'equals', 'copy', 'distanceSquared'] + apiProperties: ['x', 'y', 'z', 'magnitude', 'heading', 'distance', 'dot', 'equals', 'copy', 'distanceSquared', 'rotate'] constructor: (@x=0, @y=0, @z=0) ->