From f599c7edf7e635241e839fc024e4016ae0dcc210 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 31 Oct 2014 16:03:12 -0400 Subject: intersection test 2 - hit-testing on wall structure --- public/assets/test/intersect2.html | 218 +++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 public/assets/test/intersect2.html (limited to 'public/assets/test/intersect2.html') diff --git a/public/assets/test/intersect2.html b/public/assets/test/intersect2.html new file mode 100644 index 0000000..fade288 --- /dev/null +++ b/public/assets/test/intersect2.html @@ -0,0 +1,218 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3-70-g09d2 From 60e86d8be94281d06d5327d6dad46b98e5df6a62 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 31 Oct 2014 16:53:44 -0400 Subject: enabling mobile routes --- public/assets/javascripts/ui/_router.js | 12 ++++++++++++ public/assets/test/intersect2.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'public/assets/test/intersect2.html') diff --git a/public/assets/javascripts/ui/_router.js b/public/assets/javascripts/ui/_router.js index 0c95664..d5a8e7f 100644 --- a/public/assets/javascripts/ui/_router.js +++ b/public/assets/javascripts/ui/_router.js @@ -18,6 +18,7 @@ var SiteRouter = Router.extend({ routes: { "/": 'home', + "/home": 'home', "/login": 'signin', "/signup": 'signup', @@ -45,7 +46,16 @@ var SiteRouter = Router.extend({ mobileRoutes: { "/": 'home', "/home": 'home', + "/login": 'signin', + "/signup": 'signup', + "/auth/usernameTaken": 'usernameTaken', + "/auth/password": 'passwordReset', + "/auth/forgotPassword": 'passwordForgot', + "/profile": 'profile', + "/profile/edit": 'editProfile', + "/profile/:name": 'profile', + "/project/:name": 'projectViewer', }, @@ -63,10 +73,12 @@ var SiteRouter = Router.extend({ this.route() + /* if (is_mobile) { $(".topLinks").hide() $(".share").hide() } + */ $("body").removeClass("loading") }, diff --git a/public/assets/test/intersect2.html b/public/assets/test/intersect2.html index fade288..3df9f30 100644 --- a/public/assets/test/intersect2.html +++ b/public/assets/test/intersect2.html @@ -55,7 +55,7 @@ var rect_room = new Room({ id: "rect", rect: rect, height: 2 }) var east_room = new Room({ id: "east", rect: east, height: 2 }) var corner_room = new Room({ id: "corner", rect: corner, height: 2 }) var peninsula_room = new Room({ id: "peninsula", rect: peninsula, height: 3 }) -var peninsula2_room = new Room({ id: "peninsula2", rect: peninsula2, height: 3 }) +var peninsula2_room = new Room({ id: "peninsula2", rect: peninsula2, height: 1 }) Rooms.add( rect_room ) Rooms.add( east_room ) -- cgit v1.2.3-70-g09d2 From d67ead4ebbe27dc66d89927ff3ab91662fabdae4 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 3 Feb 2015 13:25:23 -0500 Subject: fix tests --- public/assets/javascripts/app.js | 2 -- public/assets/javascripts/mx/mx.js | 16 ++++++++-------- public/assets/javascripts/vendor/polyfill.js | 3 ++- public/assets/test/intersect2.html | 5 +++-- public/assets/test/intersect3.html | 5 +++-- public/assets/test/surface.html | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) (limited to 'public/assets/test/intersect2.html') diff --git a/public/assets/javascripts/app.js b/public/assets/javascripts/app.js index a146325..6ff062e 100644 --- a/public/assets/javascripts/app.js +++ b/public/assets/javascripts/app.js @@ -23,8 +23,6 @@ app.launch = function () { var movements - app.devicePixelRatio = is_mobile ? devicePixelRatio : 1 - scene = new MX.Scene().addTo('#scene') scene.width = window.innerWidth scene.height = window.innerHeight diff --git a/public/assets/javascripts/mx/mx.js b/public/assets/javascripts/mx/mx.js index ab9a9a0..60651eb 100644 --- a/public/assets/javascripts/mx/mx.js +++ b/public/assets/javascripts/mx/mx.js @@ -25,7 +25,7 @@ var MX = MX || (function (undefined) { var MX = { version: '0.1.0', prefix: undefined, - rotationUnit: 'rad' + rotationUnit: 'rad', } var floatPrecision = 5 @@ -162,24 +162,24 @@ var MX = MX || (function (undefined) { Object.defineProperty(this, 'width', { get: function () { return width - || parseInt(self.el.style.width, 10) * app.devicePixelRatio + || parseInt(self.el.style.width, 10) * app_devicePixelRatio || 0 }, set: function (val) { width = val - this.el.style.width = (width/app.devicePixelRatio) + 'px' + this.el.style.width = (width/app_devicePixelRatio) + 'px' } }) Object.defineProperty(this, 'height', { get: function () { return height - || parseInt(self.el.style.height, 10) * app.devicePixelRatio + || parseInt(self.el.style.height, 10) * app_devicePixelRatio || 0 }, set: function (val) { height = val - this.el.style.height = (height/app.devicePixelRatio) + 'px' + this.el.style.height = (height/app_devicePixelRatio) + 'px' } }) } @@ -302,9 +302,9 @@ var MX = MX || (function (undefined) { + (-this.y).toFixed(floatPrecision) + 'px,' + (-this.z).toFixed(floatPrecision) + 'px) ' + 'scale3d(' - + (app.devicePixelRatio * this.scaleX).toFixed(floatPrecision) + ',' - + (app.devicePixelRatio * this.scaleY).toFixed(floatPrecision) + ',' - + (app.devicePixelRatio * this.scaleZ).toFixed(floatPrecision) + ') ' + + (app_devicePixelRatio * this.scaleX).toFixed(floatPrecision) + ',' + + (app_devicePixelRatio * this.scaleY).toFixed(floatPrecision) + ',' + + (app_devicePixelRatio * this.scaleZ).toFixed(floatPrecision) + ') ' if (rotationTranslation) { transformString += rotationTranslation.before diff --git a/public/assets/javascripts/vendor/polyfill.js b/public/assets/javascripts/vendor/polyfill.js index 499cbc5..2139618 100644 --- a/public/assets/javascripts/vendor/polyfill.js +++ b/public/assets/javascripts/vendor/polyfill.js @@ -48,7 +48,7 @@ function has3d(){ } else if ( browser.webkit ) { browser.safari = true; } - $.browser = browser; + if (window.$) $.browser = browser; return browser; })( navigator.userAgent ); @@ -58,6 +58,7 @@ var is_ipad = (navigator.userAgent.match(/iPad/i)) var is_android = (navigator.userAgent.match(/Android/i)) var is_mobile = is_iphone || is_ipad || is_android var is_desktop = ! is_mobile; +var app_devicePixelRatio = is_mobile ? devicePixelRatio : 1; // rAF shim diff --git a/public/assets/test/intersect2.html b/public/assets/test/intersect2.html index 3df9f30..9a6deb2 100644 --- a/public/assets/test/intersect2.html +++ b/public/assets/test/intersect2.html @@ -6,9 +6,10 @@ body,html{margin:0;padding:0;}
- - + + + diff --git a/public/assets/test/intersect3.html b/public/assets/test/intersect3.html index 5440a76..0db85f0 100644 --- a/public/assets/test/intersect3.html +++ b/public/assets/test/intersect3.html @@ -6,9 +6,10 @@ body,html{margin:0;padding:0;}
- - + + + diff --git a/public/assets/test/surface.html b/public/assets/test/surface.html index 85e3a7b..02be479 100644 --- a/public/assets/test/surface.html +++ b/public/assets/test/surface.html @@ -1,7 +1,7 @@ - + -- cgit v1.2.3-70-g09d2 From 7da20303ba24f40366e94586b45efd2f04734338 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 3 Feb 2015 13:45:31 -0500 Subject: hidpi canvas polyfill --- bower.json | 3 ++- public/assets/test/bg.html | 1 + public/assets/test/intersect.html | 5 +++-- public/assets/test/intersect2.html | 7 ++++--- public/assets/test/intersect3.html | 7 ++++--- public/assets/test/surface.html | 5 +++-- 6 files changed, 17 insertions(+), 11 deletions(-) (limited to 'public/assets/test/intersect2.html') diff --git a/bower.json b/bower.json index 5f35d6c..c78310d 100644 --- a/bower.json +++ b/bower.json @@ -9,6 +9,7 @@ "fiber": "", "jquery-jsonview": "1.2.0", "prefixfree": "", - "marked": "0.3.2" + "marked": "0.3.2", + "hidpi-canvas": "~1.0.9" } } diff --git a/public/assets/test/bg.html b/public/assets/test/bg.html index fecf811..65dd5d9 100644 --- a/public/assets/test/bg.html +++ b/public/assets/test/bg.html @@ -5,6 +5,7 @@
+ diff --git a/public/assets/test/intersect.html b/public/assets/test/intersect.html index 4e5b0bb..92f1d5d 100644 --- a/public/assets/test/intersect.html +++ b/public/assets/test/intersect.html @@ -2,6 +2,7 @@
+ @@ -10,11 +11,11 @@ + @@ -30,12 +31,12 @@ body,html{margin:0;padding:0;} + @@ -30,12 +31,12 @@ body,html{margin:0;padding:0;} + @@ -9,11 +10,11 @@