SimplePanoramaViewer/js/photo-sphere-viewer.min.js

7 lines
86 KiB
JavaScript
Raw Normal View History

/*!
* Photo Sphere Viewer 3.3.2
* Copyright (c) 2014-2015 Jérémy Heleine
* Copyright (c) 2015-2018 Damien "Mistic" Sorel
* Licensed under MIT (http://opensource.org/licenses/MIT)
*/
!function(t,e){"function"==typeof define&&define.amd?define(["three","d.js","uevent","dot/doT"],e):"object"==typeof module&&module.exports?module.exports=e(require("three"),require("d.js"),require("uevent"),require("dot/doT")):t.PhotoSphereViewer=e(t.THREE,t.D,t.uEvent,t.doT)}(this,function(t,e,i,o){"use strict";function n(e){if(!(this instanceof n))return new n(e);if(n.SYSTEM.loaded||n._loadSystem(),this.config=M.clone(n.DEFAULTS),M.deepmerge(this.config,e),!e.container)throw new b("No value given for container.");if(!n.SYSTEM.isCanvasSupported)throw new b("Canvas is not supported.");if(!(n.SYSTEM.isWebGLSupported&&this.config.webgl||M.checkTHREE("CanvasRenderer","Projector")))throw new b("Missing Three.js components: CanvasRenderer, Projector. Get them from three.js-examples package.");if(this.config.longitude_range&&2!==this.config.longitude_range.length&&(this.config.longitude_range=null,console.warn("PhotoSphereViewer: longitude_range must have exactly two elements.")),this.config.latitude_range?2!==this.config.latitude_range.length?(this.config.latitude_range=null,console.warn("PhotoSphereViewer: latitude_range must have exactly two elements.")):this.config.latitude_range[0]>this.config.latitude_range[1]&&(this.config.latitude_range=[this.config.latitude_range[1],this.config.latitude_range[0]],console.warn("PhotoSphereViewer: latitude_range values must be ordered.")):void 0===this.config.tilt_up_max&&void 0===this.config.tilt_down_max||(this.config.latitude_range=[void 0!==this.config.tilt_down_max?this.config.tilt_down_max-Math.PI/4:-M.HalfPI,void 0!==this.config.tilt_up_max?this.config.tilt_up_max+Math.PI/4:M.HalfPI],console.warn("PhotoSphereViewer: tilt_up_max and tilt_down_max are deprecated, use latitude_range instead.")),this.config.max_fov<this.config.min_fov){var i=this.config.max_fov;this.config.max_fov=this.config.min_fov,this.config.min_fov=i,console.warn("PhotoSphereViewer: max_fov cannot be lower than min_fov.")}this.config.cache_texture&&(!M.isInteger(this.config.cache_texture)||this.config.cache_texture<0)&&(this.config.cache_texture=n.DEFAULTS.cache_texture,console.warn("PhotoSphereViewer: invalid value for cache_texture")),"panorama_roll"in this.config&&(this.config.sphere_correction.roll=this.config.panorama_roll,console.warn("PhotoSphereViewer: panorama_roll is deprecated, use sphere_correction.roll instead")),this.config.min_fov=M.bound(this.config.min_fov,1,179),this.config.max_fov=M.bound(this.config.max_fov,1,179),null===this.config.default_fov?this.config.default_fov=this.config.max_fov/2+this.config.min_fov/2:this.config.default_fov=M.bound(this.config.default_fov,this.config.min_fov,this.config.max_fov),this.config.default_long=M.parseAngle(this.config.default_long),this.config.default_lat=M.parseAngle(this.config.default_lat,!0),this.config.sphere_correction.pan=M.parseAngle(this.config.sphere_correction.pan,!0),this.config.sphere_correction.tilt=M.parseAngle(this.config.sphere_correction.tilt,!0),this.config.sphere_correction.roll=M.parseAngle(this.config.sphere_correction.roll,!0),null===this.config.anim_lat?this.config.anim_lat=this.config.default_lat:this.config.anim_lat=M.parseAngle(this.config.anim_lat,!0),this.config.longitude_range&&(this.config.longitude_range=this.config.longitude_range.map(function(t){return M.parseAngle(t)})),this.config.latitude_range&&(this.config.latitude_range=this.config.latitude_range.map(function(t){return M.parseAngle(t,!0)})),this.config.anim_speed=M.parseSpeed(this.config.anim_speed),this.config.caption&&!this.config.navbar&&(this.config.navbar=["caption"]),!0===this.config.fisheye?this.config.fisheye=1:!1===this.config.fisheye&&(this.config.fisheye=0),this.parent="string"==typeof e.container?document.getElementById(e.container):e.container,this.container=null,this.loader=null,this.navbar=null,this.hud=null,this.panel=null,this.tooltip=null,this.canvas_container=null,this.renderer=null,this.scene=null,this.camera=null,this.mesh=null,this.raycaster=null,this.doControls=null,this.prop={isCubemap:void 0,longitude:0,latitude:0,direction:null,anim_speed: