var environment = new function(){} environment.init = function(){ window.scene && scene.camera.move({ "x": 1000, "y": 1500, "z": 250, "rotationX": 0, // PI/2, "rotationY": PI/2, // PI }) // map.center.a = scene.camera.x // map.center.b = scene.camera.z map.center.a = 0 map.center.b = 0 clipper.rooms.push( new room ({ rect: new rect(0,0, 500,500), height: 500, })) clipper.rooms.push( new room ({ rect: new rect(600,0, 1100,500), height: 500, })) clipper.rooms.push( new room ({ rect: new rect(450,150, 650,350), height: 300, })) app.movements.gravity(true) if (window.location.href.match(/stone/)) { app.on("clip", function(){ $(".face").css({ "background-image": "url(http://i.asdf.us/im/4a/_1398144847_frankhats.gif)" }) }) $("#map").hide() } builder.init() clipper.init() mover.init() window.scene && scene.update() environment.update() } environment.update = function(t){ if (window.scene && scene.camera) { // map.center.a = scene.camera.x // map.center.b = -scene.camera.z } else { requestAnimationFrame(environment.update) } map.update() z = false }