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

7 lines
99 KiB
JavaScript
Raw Normal View History

/*!
* Photo Sphere Viewer 3.5.1
* Copyright (c) 2014-2015 Jérémy Heleine
* Copyright (c) 2015-2019 Damien "Mistic" Sorel
* Licensed under MIT (https://opensource.org/licenses/MIT)
*/
!function(t,e){"function"==typeof define&&define.amd?define(["three","uevent","dot/doT"],e):"object"==typeof module&&module.exports?module.exports=e(require("three"),require("uevent"),require("dot/doT")):t.PhotoSphereViewer=e(t.THREE,t.uEvent,t.doT)}(this,function(u,t,o){"use strict";function d(t){if(!(this instanceof d))return new d(t);if(d.SYSTEM.loaded||d._loadSystem(),this.config=k.clone(d.DEFAULTS),k.deepmerge(this.config,t),!t.container)throw new x("No value given for container.");if(!d.SYSTEM.isCanvasSupported)throw new x("Canvas is not supported.");if(!(d.SYSTEM.isWebGLSupported&&this.config.webgl||k.checkTHREE("CanvasRenderer","Projector")))throw new x("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:-k.HalfPI,void 0!==this.config.tilt_up_max?this.config.tilt_up_max+Math.PI/4:k.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 e=this.config.max_fov;this.config.max_fov=this.config.min_fov,this.config.min_fov=e,console.warn("PhotoSphereViewer: max_fov cannot be lower than min_fov.")}this.config.cache_texture&&(!k.isInteger(this.config.cache_texture)||this.config.cache_texture<0)&&(this.config.cache_texture=d.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")),"gyroscope"in this.config&&console.warn("PhotoSphereViewer: gyroscope is deprecated, the control is automatically created if DeviceOrientationControls.js is loaded"),!0===this.config.keyboard&&(this.config.keyboard=k.clone(d.DEFAULTS.keyboard)),this.config.min_fov=k.bound(this.config.min_fov,1,179),this.config.max_fov=k.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=k.bound(this.config.default_fov,this.config.min_fov,this.config.max_fov),null===this.config.anim_lat?this.config.anim_lat=this.config.default_lat:this.config.anim_lat=k.parseAngle(this.config.anim_lat,!0),this.config.longitude_range&&(this.config.longitude_range=this.config.longitude_range.map(function(t){return k.parseAngle(t)})),this.config.latitude_range&&(this.config.latitude_range=this.config.latitude_range.map(function(t){return k.parseAngle(t,!0)})),this.config.anim_speed=k.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 t.container?document.getElementById(t.container):t.container,this.container=null,this.loader=null,this.navbar=null,this.hud=null,this.panel=null,this.tooltip=null,this.notification=null,this.overlay=null,this.canvas_container=null,this.renderer=null,this.stereoEffect=null,this.noSleep=null,this.scene=null,this.camera=null,this.mesh=null,this.raycaster=null,this.doControls=null,this.prop={needsUpdate:!0,isCubemap:void 0,position:{longitude:0,latitude:0},ready:!1,direction:null,anim_speed:0,zoom_lvl:0,vFov:0,hFov:0,aspect:0,move_speed:.1,movin