summaryrefslogtreecommitdiff
path: root/assets/javascripts/rectangles/map/_map.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-04-21 18:44:06 -0400
committerJules Laplace <jules@okfoc.us>2014-04-21 18:44:06 -0400
commit5e795dbab647d9d8c4285233e1efc6262d49f720 (patch)
tree2d727f1947af8650db5cfc5ac2f0f8e1fad744bd /assets/javascripts/rectangles/map/_map.js
parent0a7a3a60b15d9bd6cdb9e7f153eb93f6686b8c37 (diff)
coordinate stuff
Diffstat (limited to 'assets/javascripts/rectangles/map/_map.js')
-rw-r--r--assets/javascripts/rectangles/map/_map.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/assets/javascripts/rectangles/map/_map.js b/assets/javascripts/rectangles/map/_map.js
index d8fdc79..64013cd 100644
--- a/assets/javascripts/rectangles/map/_map.js
+++ b/assets/javascripts/rectangles/map/_map.js
@@ -7,6 +7,12 @@ var map = new function(){
var base = this
base.bounds = new vec2(500,500)
base.center = new vec2(0,0)
+
+ base.sides = function(){
+ var sides = base.bounds.clone().div(2).div(base.zoom)
+ return new rect( base.center.a - sides.a, base.center.b - sides.b,
+ base.center.a + sides.a, base.center.b + sides.b )
+ }
base.zoom = 1/4