-
Notifications
You must be signed in to change notification settings - Fork 1
/
anima.min.js.map
1 lines (1 loc) · 51.8 KB
/
anima.min.js.map
1
{"version":3,"file":"generated.js","sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","src/anima.js","src/frames.js","src/gl.js","src/keys.js","src/movable.js","src/movable2d.js","src/movable3d-upright.js","src/movable3d.js"],"names":["e","exports","module","define","amd","f","window","global","self","Anima","t","n","r","s","o","u","a","require","i","Error","code","l","call","length",1,"KEYS","FrameManager","GL","Movable","Movable2D","Movable3D","Movable3DUpright","nativeRequestAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","callback","element","setTimeout","Date","valueOf","this","next_id","NaN","prev_time","last_frame_start","dt","DEFAULT_DT","drawCallback","requestFrame","bind","drawWrapper","lod","lod_modes","prototype","currentFrameTime","addLOD","name","options","LOD","key","hasOwnProperty","selectLOD","adjustLOD","frame_time","frame_min","up","frame_max","down","upLOD","downLOD","time_scheduled","setFrameStart","draw_again","apply","arguments","performance","now","frame_manager","$","GLWrapper","canvas","gl","context_serial","shader_sources","shaders","projection_matrix","Float32Array","handleContextLost","handleContextRestored","resize","bindCanvas","Texture","image_data","generators","size","width","_gl_texture","_mipmaps","getGLTexture","createTexture","bindTexture","TEXTURE_2D","pixelStorei","UNPACK_FLIP_Y_WEBGL","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","getMipmaps","generateMipmaps","data","setupCallback","resizeCallback","w","h","getContext","addEventListener","linkProgram","height","viewport","preventDefault","removeEventListener","setProjectionMatrix","m","addProgram","vert","frag","addProgramByURLs","tryCompiling","index","loaded","get","compile","source","ans","createShader","TYPES","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","isContextLost","getShaderInfoLog","VERTEX_SHADER","FRAGMENT_SHADER","objs","map","prog","createProgram","attachShader","getProgramParameter","LINK_STATUS","getProgramInfoLog","keys","SHIFT","ESC","SPACE","LEFT","UP","RIGHT","DOWN","<",">","QUESTION","TILDE","APOSTROPHE","String","fromCharCode","Hammer","velocity","speed","key_map","keys_down","touch_map","pan_x","which","amount","pan_y","rotate","pinch","wheel","decay_rate","decay_coast","is_hammer_busy","zoom_center","screen_center","run_multiplier","decay_brake","overlay_selector","default_dt","pan","threshold","pointers","updateVelocity","decay","cap","ds","Math","abs","max","accel_rate","vmax","canAccelerate","km","update","last_dt","isMoving","move","motionCallback","bindKeyboard","bindTouch","press","motion_changed","shiftKey","moveReset","release","releaseAll","type","toElement","k","on","hammer","last","last_pointers","originalEvent","isNaN","pageX","pageY","delta_y","wheelDelta","detail","touchVelocity","setScreenCenter","relatedTarget","touchEnd","Manager","add","Pan","Rotate","recognizeWith","Pinch","prev","session","prevInput","incTime","deltaTime","incX","deltaX","incY","deltaY","incScale","scale","rot","rotation","incRotation","PI","center","x","y","timeStamp","scl","movePinch","moveRotate","movePan","weight","min","isFinal","value","p","offset","left","scrollLeft","top","scrollTop","is","position","cos","sin","units_per_px","Object","create","moveZoomWithCenter","ix","iy","angle","cx","cy","moveZoom","isFinite","exp","log","angle_xz","angle_zy","TWOPI","HALFPI","moveRotateMix","from","to","setRotation","cxz","sxz","czy","szy","moveResetSuper","movePanSuper","moveRBVSuper","moveRotateByVelocity","Z","origin","displacement","fly_center","moveFly","c","distance","d","isMovingSuper","touchEndSuper","bindTouchSuper","Press"],"mappings":"AAAA,CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAA,oBAAAC,QAAAD,EAAAC,OAAA,mBAAAC,QAAAF,EAAAE,OAAA,mBAAAC,QAAAH,EAAAG,MAAAH,EAAAI,MAAAT,MAAA,WAAA,MAAA,SAAAA,GAAAU,EAAAC,EAAAC,GAAA,QA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AAAiJ,gBAAA1R,KAAA+K,SACA/K,MAAA+K,UAAA,SAAAnL,SACA8R,eAAA/S,KAAAqB,KAAAJ,QACA,IAAAmF,GAAA/E,KAAA0L,MACA3G,GAAA0H,IAAA,GAAApE,QAAAsJ,OAAA/H,UAAA,KAAAgD,cAAA7H,EAAAiB,IAAA,SACAjB,EAAA0G,GAAA,QAAA,SAAApO,GACA2C,KAAAyI,UAAA,OAAA,EACAzI,KAAAkJ,WAAAlJ,KAAAmJ,YACAnJ,KAAA6K,kBACApK,KAAAT,OACA+E,EAAA0G,GAAA,YAAA,SAAApO,GACA2C,KAAAmR,WAAA,GAAA9T,EAAAwQ,OAAAC,EACA9N,KAAAmR,WAAA,GAAA9T,EAAAwQ,OAAAE,GACAtN,KAAAT,SAEArB,KAAAQ,UAAA0B,WAEAtD,OAAAD,QAAA6B;APxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC3KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","module.exports = {\n\t\"KEYS\": require('./keys.js'),\n\t\"FrameManager\": require('./frames.js'),\n\t\"GL\": require('./gl.js'),\n\t\"Movable\": require('./movable.js'),\n\t\"Movable2D\": require('./movable2d.js'),\n\t\"Movable3D\": require('./movable3d.js'),\n\t\"Movable3DUpright\": require('./movable3d-upright.js'),\n};\n","var nativeRequestAnimFrame =\n\twindow.requestAnimationFrame ||\n\twindow.webkitRequestAnimationFrame ||\n\twindow.mozRequestAnimationFrame ||\n\twindow.oRequestAnimationFrame ||\n\twindow.msRequestAnimationFrame ||\n\tfunction (callback, element) {\n\t\twindow.setTimeout(function () {\n\t\t\treturn callback((new Date()).valueOf() + 16);\n\t\t}, 16);\n\t};\n\nvar FrameManager = function (callback) {\n\t// callback's args are those of window.requestAnimationFrame.\n\t// Its return value answers \"Do I need to draw again?\".\n\t// \"this\" is the FrameManager instance, which precomputes:\n\t// this.prev_time = scheduled time for the frame that\n\t// triggered this one via its return value\n\t// this.dt = ticks since prev_time || this.DEFAULT_DT\n\t// You can also call this.currentFrameTime(), which tells the\n\t// milliseconds elapsed since this frame started being drawn.\n\tthis.next_id = NaN;\n\tthis.prev_time = NaN;\n\tthis.last_frame_start = NaN;\n\tthis.dt = this.DEFAULT_DT;\n\tthis.drawCallback = callback || function () {};\n\tthis.requestFrame = this.requestFrame.bind(this);\n\tthis.drawWrapper = this.drawWrapper.bind(this);\n\tthis.lod = null;\n\tthis.lod_modes = {};\n};\n\nFrameManager.prototype = {\n\tDEFAULT_DT: 16,\n\n\t// Public API\n\trequestFrame: function () {\n\t\tif (!this.next_id) {\n\t\t\tthis.next_id = nativeRequestAnimFrame(this.drawWrapper);\n\t\t}\n\t\treturn this.next_id;\n\t},\n\tcurrentFrameTime: function () {\n\t\treturn ((new Date()).valueOf() - this.last_frame_start) || 16;\n\t},\n\taddLOD: function (name, options) {\n\t\tthis.lod_modes[name] = new FrameManager.LOD(this);\n\t\tfor (var key in options) {\n\t\t\tif (options.hasOwnProperty(key)) {\n\t\t\t\tthis.lod_modes[name][key] = options[key];\n\t\t\t}\n\t\t}\n\t},\n\tselectLOD: function (name) {\n\t\tthis.lod = this.lod_modes[name];\n\t},\n\tadjustLOD: function () {\n\t\tvar frame_time = this.currentFrameTime();\n\t\tif (frame_time < this.lod.frame_min) { this.lod.up(); }\n\t\telse if (frame_time > this.lod.frame_max) { this.lod.down(); }\n\t},\n\t// Replace these functions to adjust the LOD.\n\tupLOD: function () {},\n\tdownLOD: function () {},\n\n\t// Internal functions\n\tdrawWrapper: function (time_scheduled) {\n\t\tthis.next_id = NaN;\n\t\tthis.setFrameStart(time_scheduled);\n\t\tthis.dt = (time_scheduled - this.prev_time) || this.DEFAULT_DT;\n\t\t// Call the user-supplied callback. Might take a while.\n\t\tvar draw_again = this.drawCallback.apply(this, arguments);\n\t\t// Request another frame if we need to.\n\t\t// Is after the callback for better chances of making the deadline.\n\t\tif (draw_again) {\n\t\t\tthis.prev_time = time_scheduled;\n\t\t\tthis.requestFrame();\n\t\t} else {\n\t\t\tthis.prev_time = NaN;\n\t\t}\n\t},\n\tsetFrameStart: function (time_scheduled) {\n\t\tthis.last_frame_start = (new Date()).valueOf();\n\t},\n};\n\nif (window.performance && window.performance.now) {\n\tFrameManager.prototype.setFrameStart = function (time_scheduled) {\n\t\tthis.last_frame_start = time_scheduled;\n\t};\n\tFrameManager.prototype.currentFrameTime = function () {\n\t\treturn (window.performance.now() - this.last_frame_start) || 16;\n\t};\n}\n\nFrameManager.LOD = function (frame_manager) {\n\tthis.frame_manager = frame_manager;\n};\nFrameManager.LOD.prototype = {\n\tframe_min: 8,\n\tframe_max: 16,\n\tup: function () { this.frame_manager.upLOD(); },\n\tdown: function () { this.frame_manager.downLOD(); },\n};\n\nmodule.exports = FrameManager;\n","var $ = (typeof window !== \"undefined\" ? window.$ : typeof global !== \"undefined\" ? global.$ : null);\n\nvar GLWrapper = function (canvas) {\n\t// Declare some properties\n\tthis.gl = null;\n\tthis.context_serial = 0;\n\tthis.shader_sources = {};\n\tthis.shaders = {};\n\tthis.projection_matrix = new Float32Array(16);\n\t// Set bound methods\n\tthis.handleContextLost = this.handleContextLost.bind(this);\n\tthis.handleContextRestored = this.handleContextRestored.bind(this);\n\tthis.resize = this.resize.bind(this);\n\t// Bind the canvas\n\tif (canvas) { this.bindCanvas(canvas); }\n};\n\nvar Texture = function (image_data, generators) {\n\tthis.image_data = image_data;\n\tthis.size = image_data.width;\n\tthis.generators = generators || [];\n};\n\nTexture.prototype = {\n\t_gl_texture: null,\n\t_mipmaps: null,\n\tgetGLTexture: function (gl) {\n\t\tif (this._gl_texture) { return this._gl_texture; }\n\t\tvar t = this._gl_texture = gl.createTexture();\n\t\tgl.bindTexture(gl.TEXTURE_2D, t);\n\t\tgl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this.image_data);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);\n\t\tgl.generateMipmap(gl.TEXTURE_2D);\n\t\tgl.bindTexture(gl.TEXTURE_2D, null);\n\t\treturn t;\n\t},\n\tgetMipmaps: function () {\n\t\tif (this._mipmaps) { return this._mipmaps; }\n\t\tthis._mipmaps = generateMipmaps(this.image_data.data, this.size);\n\t\treturn this._mipmaps;\n\t},\n};\n\nGLWrapper.prototype = {\n\t// Overrideable methods\n\tsetupCallback: function () {},\n\tresizeCallback: function (w, h) {},\n\n\t// Initialization\n\tbindCanvas: function (canvas) {\n\t\tthis.canvas = canvas;\n\t\t// Get context\n\t\tif (!canvas.getContext) { return null; }\n\t\tthis.gl = canvas.getContext('webgl') ||\n\t\t\tcanvas.getContext('experimental-webgl');\n\t\tif (!this.gl) {\n\t\t\tthrow 'WebGL unavailable.';\n\t\t\treturn false;\n\t\t}\n\t\tthis.context_serial++;\n\t\t// Handle context loss\n\t\tthis.canvas.addEventListener('webglcontextlost',\n\t\t\tthis.handleContextLost, false);\n\t\tthis.canvas.addEventListener('webglcontextrestored',\n\t\t\tthis.handleContextRestored, false);\n\t\t// Set up shaders\n\t\tfor (var name in this.shader_sources) {\n\t\t\tthis.linkProgram(name);\n\t\t}\n\t\tthis.setupCallback();\n\t},\n\n\t////////////////////\n\t// Event Handlers //\n\t////////////////////\n\n\t// Screen resizing\n\tresize: function (w, h) {\n\t\tthis.canvas.width = w;\n\t\tthis.canvas.height = h;\n\t\tif (this.gl) { this.gl.viewport(0, 0, w, h); }\n\t\tthis.resizeCallback(w, h);\n\t},\n\t// Context events\n\thandleContextLost: function (e) {\n\t\te.preventDefault();\n\t\tthis.canvas.removeEventListener('webglcontextlost',\n\t\t\tthis.handleContextLost, false);\n\t},\n\thandleContextRestored: function (e) {\n\t\tthis.bindCanvas(this.canvas);\n\t},\n\n\t///////////////\n\t// Internals //\n\t///////////////\n\n setProjectionMatrix: function (w, h, n, f) {\n\t\t// Generate a projection matrix toward 0 onto a rectangle at z = 1.\n\t\t// Matrix entries by column left-to-right, down each column.\n\t\t/*[\n\t\t\t1/w, 0, 0, 0,\n\t\t\t0, 1/h, 0, 0,\n\t\t\t0, 0, (n+f)/(n-f), -1, // new z\n\t\t\t0, 0, 2*n*f/(n-f), 0, // old z becomes last coordinate for division\n\t\t]*/\n\t\tvar m = this.projection_matrix;\n\t\tm[0] = 1/w;\n\t\tm[5] = 1/h;\n\t\tm[10] = (n+f)/(n-f); // new z\n\t\tm[11] = -1;\n\t\tm[14] = 2*n*f/(n-f); // old z becomes last coordinate for division\n\t\tm[1] = m[2] = m[3] = m[4] = m[6] = m[7] = m[8] = m[9] = m[12] = m[13] = m[15] = 0;\n\t},\n\n\t// Shader loading\n\taddProgram: function (name, vert, frag) {\n\t\t// Add a shader program.\n\t\t// name = symbolic name\n\t\t// vert = code for the vertex shader\n\t\t// frag = code for the fragment shader\n\t\tthis.shader_sources[name] = [vert, frag];\n\t\tif (this.gl) { this.linkProgram(name); }\n\t},\n\taddProgramByURLs: function (name, vert, frag, callback) {\n\t\t// Add a shader program with URLs instead of code.\n\t\t// Requires jQuery.\n\t\tvar code = ['', ''];\n\t\tvar loaded = 0;\n\t\tfunction tryCompiling(index, data) {\n\t\t\tloaded |= (1 << index);\n\t\t\tcode[index] = data;\n\t\t\tif ((loaded & 3) == 3) {\n\t\t\t\tthis.addProgram(name, code[0], code[1]);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t\t$.get(vert, tryCompiling.bind(this, 0));\n\t\t$.get(frag, tryCompiling.bind(this, 1));\n\t},\n\tlinkProgram: function (name) {\n\t\tif (!this.shader_sources[name]) { return null; }\n\t\tvar gl = this.gl;\n\t\tvar TYPES = [gl.VERTEX_SHADER, gl.FRAGMENT_SHADER];\n\t\tfunction compile(source, i) {\n\t\t\tvar ans = gl.createShader(TYPES[i]);\n\t\t\tgl.shaderSource(ans, source);\n\t\t\tgl.compileShader(ans);\n\t\t\tif (!gl.getShaderParameter(ans, gl.COMPILE_STATUS) &&\n\t\t\t\t!gl.isContextLost()) {\n\t\t\t\tthrow 'Shader compile error: ' + gl.getShaderInfoLog(ans);\n\t\t\t}\n\t\t\treturn ans;\n\t\t}\n\t\tvar objs = this.shader_sources[name].map(compile);\n\t\tvar prog = gl.createProgram();\n\t\tgl.attachShader(prog, objs[0]);\n\t\tgl.attachShader(prog, objs[1]);\n\t\tgl.linkProgram(prog);\n\t\tif (!gl.getProgramParameter(prog, gl.LINK_STATUS) &&\n\t\t\t!gl.isContextLost()) {\n\t\t\tthrow 'Shader link error: ' + gl.getProgramInfoLog(prog);\n\t\t}\n\t\tthis.shaders[name] = prog;\n\t\treturn prog;\n\t},\n};\n\nmodule.exports = GLWrapper;\n","var keys = {\n\t\"SHIFT\": 16,\n\t\"ESC\": 27,\n\t\"SPACE\": 32,\n\t\"LEFT\": 37,\n\t\"UP\": 38,\n\t\"RIGHT\": 39,\n\t\"DOWN\": 40,\n\t\"<\": 188,\n\t\">\": 190,\n\t\"QUESTION\": 191,\n\t\"TILDE\": 192,\n\t\"APOSTROPHE\": 222,\n};\n\n/* Add letters, numbers, and F keys */\nfor (var i = 0; i < 10; i++) { keys[i] = 48 + i; }\nfor (var i = 65; i < 91; i++) { keys[String.fromCharCode(i)] = i; }\nfor (var i = 1; i < 13; i++) { keys[\"F\" + i] = 111 + i; }\n\nmodule.exports = keys;\n","var KEYS = require('./keys.js');\nvar $ = (typeof window !== \"undefined\" ? window.$ : typeof global !== \"undefined\" ? global.$ : null);\nvar Hammer = (typeof window !== \"undefined\" ? window.Hammer : typeof global !== \"undefined\" ? global.Hammer : null);\n\nvar Movable = function () {\n\tthis.velocity = [0, 0, 0, 0]; // velocity in user units (e.g. px/ms)\n\t// Configuration\n\tthis.speed = [1, 1, 0.001, 0.001]; // speed scale in user units.\n\t\t// Defaults: Move 1000px/s, rotate 1 rad/s, zoom 2.718x/s\n\tthis.key_map = {};\n\tthis.keys_down = {};\n\tthis.touch_map = {\n\t\t'pan_x': {which: 0, amount: -1},\n\t\t'pan_y': {which: 1, amount: -1},\n\t\t'rotate': {which: 2, amount: 1},\n\t\t'pinch': {which: 3, amount: 1},\n\t\t'wheel': {which: 3, amount: 1},\n\t};\n\t// Keymap\n\tthis.key_map[KEYS.LEFT] = {which: 0, amount: -1};\n\tthis.key_map[KEYS.RIGHT] = {which: 0, amount: 1};\n\tthis.key_map[KEYS.UP] = {which: 1, amount: -1};\n\tthis.key_map[KEYS.DOWN] = {which: 1, amount: 1};\n\tthis.key_map[KEYS['<']] = {which: 2, amount: -1}; // roll ACW\n\tthis.key_map[KEYS['>']] = {which: 2, amount: 1}; // roll CW\n\tthis.key_map[189] = this.key_map[173] = this.key_map[109] =\n\t\t{which: 3, amount: -1}; // zoom out (gecko's had some weird keycodes)\n\tthis.key_map[187] = this.key_map[61] = this.key_map[107] =\n\t\t{which: 3, amount: 1}; // zoom in\n\n\t// State\n\tthis.decay_rate = this.decay_coast;\n\tthis.is_hammer_busy = false;\n\tthis.zoom_center = null;\n\tthis.screen_center = [0, 0];\n};\n\nMovable.prototype = {\n\trun_multiplier: 4,\n\tdecay_coast: 0.002, // stop in about 0.5s\n\tdecay_brake: 0.01, // stop in about 0.1s\n\toverlay_selector: '.overlay',\n\tdefault_dt: 16,\n\toptions: {\n\t\tpan: {threshold: 0, pointers: 0},\n\t\trotate: {threshold: 0},\n\t\tpinch: {threshold: 0},\n\t},\n\n\tupdateVelocity: function (dt) {\n\t\tdt = dt || this.default_dt;\n\t\tvar vmax = 1;\n\t\tif (this.keys_down[KEYS.SHIFT]) { vmax *= this.run_multiplier; }\n\t\tvar decay_rate = this.decay_rate;\n\t\tvar accel_rate = this.decay_coast + this.decay_brake;\n\t\tfunction decay(t, cap) {\n\t\t\tvar s = Math.abs(t);\n\t\t\tvar ds;\n\t\t\tif (s > cap) {\n\t\t\t\treturn t * Math.max(0, 1 - dt * accel_rate);\n\t\t\t} else {\n\t\t\t\tds = dt * cap * decay_rate;\n\t\t\t\tif (t > ds) { return t - ds; }\n\t\t\t\telse if (t < -ds) { return t + ds; }\n\t\t\t\telse { return 0; }\n\t\t\t}\n\t\t};\n\t\tif (this.canAccelerate()) {\n\t\t\tfor (var key in this.key_map) {\n\t\t\t\tif (!this.key_map.hasOwnProperty(key)) { continue; }\n\t\t\t\tvar km = this.key_map[key];\n\t\t\t\tvar i = km.which;\n\t\t\t\tthis.velocity[i] = this.velocity[i] || 0;\n\t\t\t\tif (this.keys_down[key]) {\n\t\t\t\t\tthis.velocity[i] +=\n\t\t\t\t\t\taccel_rate * vmax * (this.speed[i] || 1) * km.amount * dt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < this.velocity.length; i++) {\n\t\t\tthis.velocity[i] = decay(this.velocity[i], vmax * (this.speed[i] || 1));\n\t\t}\n\t},\n\tupdate: function (dt) {\n\t\tdt = this.last_dt = dt || this.default_dt;\n\t\tthis.updateVelocity(dt);\n\t\tif (this.isMoving()) {\n\t\t\tthis.move(dt);\n\t\t\tthis.motionCallback();\n\t\t}\n\t},\n\tisMoving: function () {\n\t\tif (this.is_hammer_busy) { return false; }\n\t\tfor (var i = 0; i < this.velocity.length; i++) {\n\t\t\tif (this.velocity[i]) { return true; }\n\t\t}\n\t\tfor (var key in this.key_map) {\n\t\t\tif (this.key_map.hasOwnProperty(key) && this.keys_down[key]) { return true; }\n\t\t}\n\t\treturn false;\n\t},\n\tbind: function (element) {\n\t\tthis.bindKeyboard(element);\n\t\tthis.bindTouch(element);\n\t},\n\tbindKeyboard: function (element) {\n\t\tvar t = this;\n\t\tvar press = function (e) {\n\t\t\tvar motion_changed = true;\n\t\t\tif (t.key_map[e.which]) {\n\t\t\t\tmotion_changed = !t.keys_down[e.which];\n\t\t\t\tt.keys_down[e.which] = true;\n\t\t\t\tt.decay_rate = t.decay_brake;\n\t\t\t\tt.zoom_center = null;\n\t\t\t\tif (motion_changed) { t.motionCallback(); }\n\t\t\t\t// In theory since motionCallback calls requestAnimationFrame,\n\t\t\t\t// I could call this callback at the start...\n\t\t\t\t// ...but that'd be poking through the abstraction barrier.\n\t\t\t}\n\t\t\tt.keys_down[KEYS.SHIFT] = e.shiftKey;\n\t\t\tif (e.which == KEYS.ESC && t.canAccelerate()) {\n\t\t\t\tt.moveReset();\n\t\t\t\tt.decay_rate = t.decay_brake;\n\t\t\t\tt.zoom_center = null;\n\t\t\t\tt.motionCallback();\n\t\t\t}\n\t\t};\n\t\tvar release = function (e) {\n\t\t\tif (t.keys_down[e.which]) { t.keys_down[e.which] = false; }\n\t\t\tt.keys_down[KEYS.SHIFT] = e.shiftKey;\n\t\t};\n\t\tvar releaseAll = function (e) {\n\t\t\tif (e.type == 'mouseleave' && e.toElement) { return; }\n\t\t\tfor (var k in t.keys_down) {\n\t\t\t\tif (k != 'mouse') {\n\t\t\t\t\tt.keys_down[k] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\telement = $(element);\n\t\telement.on('keydown.mKeyboard', press);\n\t\telement.on('keyup.mKeyboard', release);\n\t\telement.on('blur.mKeyboard mouseleave.mKeyboard', releaseAll);\n\t},\n\tbindTouch: function (element) {\n\t\tvar h = this.hammer;\n\t\tvar t = this;\n\t\tvar last = null;\n\t\tvar last_pointers = null;\n\t\t$(element).on('wheel DOMMouseScroll mousewheel', function (e) {\n\t\t\t// Mousewheel zooming\n\t\t\te = e.originalEvent;\n\t\t\tif (!(isNaN(e.pageX))) { t.zoom_center = [e.pageX, e.pageY]; }\n\t\t\tvar delta_y = e.wheelDelta || (-e.detail);\n\t\t\tif (Math.abs(delta_y) > 20) { delta_y /= 120; }\n\t\t\tt.decay_rate = t.decay_coast;\n\t\t\tt.touchVelocity('wheel', delta_y/400, 0.5);\n\t\t\tt.motionCallback();\n\t\t});\n\t\tt.setScreenCenter(element);\n\t\t$(window).on('load scroll resize', function (e) {\n\t\t\tt.setScreenCenter(element);\n\t\t});\n\t\t$(element).on('mousedown selectstart', function (e) {\n\t\t\te.preventDefault();\n\t\t});\n\t\t$(window).on('mouseup touchcancel touchend mouseleave touchleave',\n\t\t\tfunction (e) {\n\t\t\t\tif (!e.relatedTarget) { t.touchEnd(); }\n\t\t\t});\n\t\tif (Hammer && !this.hammer) {\n\t\t\th = this.hammer = new Hammer.Manager($(element)[0]);\n\t\t\th.add(new Hammer.Pan(this.options.pan));\n\t\t\th.add(new Hammer.Rotate(this.options.rotate\n\t\t\t\t).recognizeWith(h.get('pan')));\n\t\t\th.add(new Hammer.Pinch(this.options.pinch\n\t\t\t\t).recognizeWith([h.get('pan'), h.get('rotate')]));\n\t\t\th.on('hammer.input', function (e) {\n\t\t\t\tvar prev = h.session.prevInput || e;\n\t\t\t\te.incTime = e.deltaTime - prev.deltaTime;\n\t\t\t\te.incX = e.deltaX - prev.deltaX;\n\t\t\t\te.incY = e.deltaY - prev.deltaY;\n\t\t\t\te.incScale = (e.scale / prev.scale) || 1.0;\n\t\t\t\t// Clamp incremental rotations to [-90, 90];\n\t\t\t\t// interpret obtuse rotations as swapped fingers.\n\t\t\t\tvar rot = (450 + e.rotation - prev.rotation) % 360 - 90;\n\t\t\t\tif (rot > 90) { rot -= 180; }\n\t\t\t\te.incRotation = rot * Math.PI / 180;\n\t\t\t\tt.is_hammer_busy = !(e.isFinal);\n\t\t\t\tt.decay_rate = t.decay_coast;\n\t\t\t\tt.zoom_center = [e.center.x, e.center.y];\n\t\t\t});\n\t\t\tthis.hammer.on('pan rotate pinch', function (e) {\n\t\t\t\t// Duplicate events are still causing some bugs here...\n\t\t\t\tif (last == e.timeStamp) { return; }\n\t\t\t\tlast = e.timeStamp;\n\t\t\t\tif (e.incTime && (last_pointers == e.pointers.length)) { // Only move if this isn't a duplicate event\n\t\t\t\t\t// Incremental scaling is clamped for continuity.\n\t\t\t\t\tvar scl = e.incScale;\n\t\t\t\t\tif (!(scl > 0.1 && scl < 10)) { scl = 1; }\n\t\t\t\t\t// Move\n\t\t\t\t\tt.movePinch(scl);\n\t\t\t\t\tt.moveRotate(e.incRotation);\n\t\t\t\t\tt.movePan(e.incX, e.incY);\n\t\t\t\t\t// Set coasting velocities averaging over the last 100ms\n\t\t\t\t\tvar weight = Math.min(1, 0.01 * e.incTime);\n\t\t\t\t\tt.touchVelocity('pan_x', e.incX / e.incTime, weight);\n\t\t\t\t\tt.touchVelocity('pan_y', e.incY / e.incTime, weight);\n\t\t\t\t\tt.touchVelocity('rotate', e.incRotation / e.incTime, weight);\n\t\t\t\t\tt.touchVelocity('pinch', (scl - 1) / e.incTime, weight);\n\t\t\t\t}\n\t\t\t\tlast_pointers = e.pointers.length;\n\t\t\t\tif (!e.isFinal) { t.is_hammer_busy = true; }\n\t\t\t\telse {\n\t\t\t\t\tlast = null;\n\t\t\t\t\tlast_pointers = null;\n\t\t\t\t}\n\t\t\t\tt.decay_rate = t.decay_coast;\n\t\t\t\tt.motionCallback();\n\t\t\t});\n\t\t}\n\t},\n\ttouchVelocity: function (key, value, weight) {\n\t\tkey = this.touch_map[key];\n\t\tif (!key) { return; }\n\t\tif (!isNaN(value)) {\n\t\t\tif (isNaN(weight)) { weight = 1; }\n\t\t\tthis.velocity[key.which] *= 1 - weight;\n\t\t\tthis.velocity[key.which] += weight * value * key.amount;\n\t\t}\n\t\treturn this.velocity[key.which];\n\t},\n\ttouchEnd: function () {\n\t\tthis.is_hammer_busy = false;\n\t},\n\tsetScreenCenter: function (element) {\n\t\tvar p = $(element).offset();\n\t\tthis.screen_center = [\n\t\t\tp.left - $(window).scrollLeft() + $(element).width()/2,\n\t\t\tp.top - $(window).scrollTop() + $(element).height()/2,\n\t\t];\n\t},\n\n\t// Default implementation\n\tcanAccelerate: function () {\n\t\t// Don't accelerate if a dialog is active.\n\t\treturn !($(this.overlay_selector).is(':target'));\n\t},\n\tmotionCallback: function () {},\n};\n\nmodule.exports = Movable;\n","var KEYS = require('./keys.js');\nvar Movable = require('./movable.js');\n\nvar Movable2D = function () {\n\t// Touch-richer variant of Movable. Requires hammer.js>=2.0.2.\n\tMovable.apply(this, arguments);\n\t// State variables\n\tthis.speed[0] = this.speed[1] = 0.002; // move 2 units/sec by default\n\tthis.position = [0, 0, 0, 0];\n\tthis.cos = 1;\n\tthis.sin = 0;\n\tthis.scale = 1;\n\tthis.units_per_px = 1;\n};\n\nMovable2D.prototype = Object.create(Movable.prototype);\n(function () {\n\tthis.move = function (dt) {\n\t\tvar s = 1 / this.units_per_px;\n\t\tthis.moveRotate(this.velocity[this.touch_map.rotate.which] * dt);\n\t\tthis.moveZoomWithCenter(this.velocity[this.touch_map.pinch.which] * dt);\n\t\tthis.movePan(this.velocity[this.touch_map.pan_x.which] * dt * s,\n\t\t\tthis.velocity[this.touch_map.pan_y.which] * dt * s);\n\t};\n\tthis.moveReset = function () {\n\t\tfor (var i = 0; i < this.velocity.length; i++) {\n\t\t\tthis.position[i] = this.velocity[i] = 0;\n\t\t}\n\t\tthis.cos = 1;\n\t\tthis.sin = 0;\n\t\tthis.scale = 1;\n\t};\n\tthis.movePan = function (x, y) {\n\t\tvar ix = this.touch_map.pan_x.which;\n\t\tvar iy = this.touch_map.pan_y.which;\n\t\tvar s = this.units_per_px / this.scale;\n\t\tx *= s;\n\t\ty *= s;\n\t\tthis.position[ix] = this.position[ix] || 0;\n\t\tthis.position[iy] = this.position[iy] || 0;\n\t\tthis.position[ix] += this.cos * x + this.sin * y;\n\t\tthis.position[iy] += -this.sin * x + this.cos * y;\n\t};\n\tthis.moveRotate = function (angle) {\n\t\tvar i = this.touch_map.rotate.which;\n\t\tvar cx = 0;\n\t\tvar cy = 0;\n\t\tif (this.zoom_center) {\n\t\t\tcx = this.zoom_center[0] - this.screen_center[0];\n\t\t\tcy = this.zoom_center[1] - this.screen_center[1];\n\t\t}\n\t\tthis.position[i] = (this.position[i] || 0) + angle;\n\t\tthis.movePan(-cx, -cy);\n\t\tthis.cos = Math.cos(this.position[i]);\n\t\tthis.sin = Math.sin(this.position[i]);\n\t\tthis.movePan(cx, cy);\n\t};\n\tthis.moveZoom = function (amount) {\n\t\tif (!isFinite(this.scale)) { this.scale = 1; }\n\t\tthis.scale *= Math.exp(amount || 0);\n\t};\n\tthis.movePinch = function (scale) {\n\t\tthis.moveZoomWithCenter(Math.log(scale));\n\t};\n\tthis.moveZoomWithCenter = function (amount) {\n\t\tvar cx = 0;\n\t\tvar cy = 0;\n\t\tif (this.zoom_center && this.screen_center) {\n\t\t\tcx = this.zoom_center[0] - this.screen_center[0];\n\t\t\tcy = this.zoom_center[1] - this.screen_center[1];\n\t\t}\n\t\tthis.movePan(-cx, -cy);\n\t\tthis.moveZoom(amount);\n\t\tthis.movePan(cx, cy);\n\t};\n}).call(Movable2D.prototype);\n\nmodule.exports = Movable2D;\n\n","var Movable3D = require('./movable3d.js');\n\nMovable3DUpright = function () {\n\tMovable3D.apply(this, arguments);\n\tthis.angle_xz = 0;\n\tthis.angle_zy = 0;\n}\nMovable3DUpright.prototype = Object.create(Movable3D.prototype);\n(function () {\n\tvar TWOPI = 2 * Math.PI;\n\tvar HALFPI = Math.PI / 2;\n\tthis.moveRotateMix = function (from, to, angle) {\n\t\tif (from < 2 && to < 2) { return; }\n\t\tif (from == 0) { this.angle_xz += angle; }\n\t\telse if (to == 0) { this.angle_xz -= angle; }\n\t\telse if (to == 1) { this.angle_zy -= angle; }\n\t\telse { this.angle_zy += angle; }\n\t};\n\tthis.setRotation = function () {\n\t\tthis.angle_xz %= TWOPI;\n\t\tthis.angle_zy = Math.max(-HALFPI, Math.min(this.angle_zy, HALFPI));\n\t\tvar cxz = Math.cos(this.angle_xz);\n\t\tvar sxz = Math.sin(this.angle_xz);\n\t\tvar czy = Math.cos(this.angle_zy);\n\t\tvar szy = Math.sin(this.angle_zy);\n\t\tthis.rotation[0][0] = cxz;\n\t\tthis.rotation[0][2] = sxz;\n\t\tthis.rotation[1][0] = -sxz * szy;\n\t\tthis.rotation[1][1] = czy;\n\t\tthis.rotation[1][2] = cxz * szy;\n\t\tthis.rotation[2][0] = -sxz * czy;\n\t\tthis.rotation[2][1] = -szy;\n\t\tthis.rotation[2][2] = cxz * czy;\n\t};\n\tvar moveResetSuper = this.moveReset;\n\tthis.moveReset = function () {\n\t\tmoveResetSuper.call(this);\n\t\tthis.angle_xz = this.angle_zy = 0;\n\t};\n\tvar movePanSuper = this.movePan;\n\tthis.movePan = function () {\n\t\tmovePanSuper.apply(this, arguments);\n\t\tthis.setRotation();\n\t};\n\tvar moveRBVSuper = this.moveRotateByVelocity;\n\tthis.moveRotateByVelocity = function (dt) {\n\t\tmoveRBVSuper.call(this, dt);\n\t\tthis.setRotation();\n\t};\n}).call(Movable3DUpright.prototype);\n\nmodule.exports = Movable3DUpright;\n","var KEYS = require('./keys.js');\nvar Movable = require('./movable.js');\n\nvar Movable3D = function () {\n\t// Touch-richer variant of Movable. Requires hammer.js>=2.0.2.\n\tMovable.apply(this, arguments);\n\t// Set speeds\n\tthis.speed[0] = this.speed[1] = 0.001; // rotate 1 rad/s by default\n\tthis.speed[4] = 0.002; // fly at 2 units per second\n\t// invert y-axis\n\tthis.key_map[KEYS.DOWN].amount *= -1;\n\tthis.key_map[KEYS.UP].amount *= -1;\n\t// flying\n\tthis.key_map['press'] = this.key_map[KEYS.SPACE] = {which: 4, amount: 1};\n\tthis.key_map[KEYS.Z] = {which: 4, amount: -1};\n\t// state variables\n\tthis.origin = null;\n\tthis.displacement = null;\n\tthis.rotation = null;\n\tthis.scale = 1;\n\t// hmmmmmmmmmmmmmm\n\tthis.units_per_px = 1;\n\tthis.fly_center = [0, 0];\n};\n\nMovable3D.prototype = Object.create(Movable.prototype);\n(function () {\n\tthis.move = function (dt) {\n\t\t// Rotation\n\t\tif (this.keys_down['press']) {\n\t\t\tthis.velocity[0] = this.speed[0] * (this.fly_center[0] - this.screen_center[0]) * this.units_per_px;\n\t\t\tthis.velocity[1] = this.speed[1] * (this.fly_center[1] - this.screen_center[1]) * this.units_per_px;\n\t\t}\n\t\tthis.moveRotateByVelocity(dt);\n\t\t// Translation\n\t\tthis.moveFly(dt * this.velocity[this.key_map.press.which]);\n\t\t// Zooming\n\t\tthis.moveZoom(dt * this.velocity[this.touch_map.pinch.which]);\n\t};\n\tthis.moveReset = function () {\n\t\tthis.origin = [0, 0, 0];\n\t\tthis.displacement = [0, 0, 0];\n\t\tthis.rotation = [\n\t\t\t[1,0,0,0],\n\t\t\t[0,1,0,0],\n\t\t\t[0,0,1,0],\n\t\t\t[0,0,0,1]\n\t\t];\n\t};\n\tthis.moveRotateByVelocity = function (dt) {\n\t\tthis.moveRotateMix(0, 2, this.velocity[this.touch_map.pan_x.which] * dt);\n\t\tthis.moveRotateMix(1, 2, -this.velocity[this.touch_map.pan_y.which] * dt);\n\t\tthis.moveRotateMix(0, 1, this.velocity[this.touch_map.rotate.which] * dt);\n\t};\n\tthis.moveRotateMix = function (from, to, angle) {\n\t\t// this.moveRoll = this.moveRotateMix.bind(this, 0, 1);\n\t\t// this.moveYaw = this.moveRotateMix.bind(this, 0, 2);\n\t\t// this.movePitch = this.moveRotateMix.bind(this, 1, 2);\n\t\tangle = angle || 0;\n\t\tvar c = Math.cos(angle);\n\t\tvar s = Math.sin(angle);\n\t\tvar t = 0;\n\t\tvar x = this.rotation[from];\n\t\tvar y = this.rotation[to];\n\t\tfor (var i = 0; i < 4; i++) {\n\t\t\tt = x[i] * c + y[i] * s;\n\t\t\ty[i] = -x[i] * s + y[i] * c;\n\t\t\tx[i] = t;\n\t\t}\n\t};\n\tthis.movePan = function (x, y) {\n\t\tif (!this.keys_down['press']) {\n\t\t\tthis.moveRotateMix(2, 0, x * this.units_per_px);\n\t\t\tthis.moveRotateMix(1, 2, y * this.units_per_px);\n\t\t}\n\t};\n\tthis.moveRotate = function (angle) {\n\t\tthis.moveRotateMix(0, 1, angle);\n\t};\n\tthis.moveZoom = function (amount) {\n\t\tif (!isFinite(this.scale)) { this.scale = 1; }\n\t\tthis.scale *= Math.exp(amount || 0);\n\t};\n\tthis.movePinch = function (scale) {\n\t\tthis.moveZoom(Math.log(scale));\n\t};\n\tthis.moveFly = function (distance) {\n\t\tif (!distance) { return; }\n\t\tvar d = distance / this.scale;\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\tthis.origin[i] += this.rotation[2][i] * d;\n\t\t}\n\t};\n\tvar isMovingSuper = this.isMoving;\n\tthis.isMoving = function () {\n\t\tif (this.keys_down['press']) { return true; }\n\t\treturn isMovingSuper.call(this);\n\t};\n\tvar touchEndSuper = this.touchEnd;\n\tthis.touchEnd = function () {\n\t\ttouchEndSuper.call(this);\n\t\tthis.keys_down['press'] = false;\n\t};\n\tvar bindTouchSuper = this.bindTouch;\n\tthis.bindTouch = function (element) {\n\t\tbindTouchSuper.call(this, element);\n\t\tvar h = this.hammer;\n\t\th.add(new Hammer.Press({threshold: 10}).recognizeWith(h.get('pan')));\n\t\th.on('press', (function (e) {\n\t\t\tthis.keys_down['press'] = true;\n\t\t\tthis.decay_rate = this.decay_coast;\n\t\t\tthis.motionCallback();\n\t\t}).bind(this));\n\t\th.on('press pan', (function (e) {\n\t\t\tthis.fly_center[0] = e.center.x;\n\t\t\tthis.fly_center[1] = e.center.y;\n\t\t}).bind(this));\n\t};\n}).call(Movable3D.prototype);\n\nmodule.exports = Movable3D;\n"]}