mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Added rotate to Vector APIs.
This commit is contained in:
parent
2a5a366c12
commit
f92b29a4a3
1 changed files with 2 additions and 2 deletions
|
@ -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) ->
|
||||
|
||||
|
|
Loading…
Reference in a new issue