diff --git a/build/mxreality.js b/build/mxreality.js index 6f42b0a..2baa8ef 100644 --- a/build/mxreality.js +++ b/build/mxreality.js @@ -21,7 +21,7 @@ var VR=function (scene,renderer,container,cameraPara,cameraPosition) { this.defaultVolume=0.3; this.sliceSegment=0; this._controlTarget={x:0.0001,y:0,z:0}; - this.recType={"video":"video","box":"box","slice":"slice"}; + this.resType={"video":"video","box":"box","slice":"slice"}; this.asteroidConfig={enable:false,assteroidFPS:36,assteroidFov:135,asteroidForwardTime:2000,asteroidWaitTime:1000,asteroidDepressionRate:0.5,asteroidTop:1,cubeResolution:2048}; this.VRhint="请取消屏幕翻转锁定后装入VR盒子中"; this.camera=new THREE.PerspectiveCamera(this.cameraPara.fov,this.cameraPara.aspect , this.cameraPara.near, this.cameraPara.far); @@ -75,10 +75,10 @@ VR.prototype.init=function () { AVR.bindOrientationEnevt(that,that._controlTarget); }, false); }; -VR.prototype.playPanorama=function (recUrl,recType,objName) { +VR.prototype.playPanorama=function (recUrl,resType,objName) { objName=objName||"__panoContainer"; var that = this; - that._containerRadius=(that.recType.box == recType|| that.recType.slice==recType) ? (that.vrbox.width / 2.1) : that.vrbox.radius; + that._containerRadius=(that.resType.box == resType|| that.resType.slice==resType) ? (that.vrbox.width / 2.1) : that.vrbox.radius; that.autoHideLeftTime = that.defaultAutoHideLeftTime; that.voiceHideLeftTime = that.defaultVoiceHideLeftTime; @@ -212,7 +212,7 @@ VR.prototype.playPanorama=function (recUrl,recType,objName) { that.videoToolBar.btn.style.borderBottom = "0.6rem solid transparent"; } - if (that.recType.box == recType) { + if (that.resType.box == resType) { var textures = []; var materials = []; @@ -241,7 +241,7 @@ VR.prototype.playPanorama=function (recUrl,recType,objName) { that.loadProgressManager.onLoad(); } imgPanoToolBar(); - }else if(that.recType.slice==recType){ + }else if(that.resType.slice==resType){ var cubeGeometry = new THREE.CubeGeometry(that.vrbox.width, that.vrbox.height, that.vrbox.depth, that.sliceSegment, that.sliceSegment, that.sliceSegment); //cubeGeometry.scale(-1, 1, 1) var textureLoader = new THREE.TextureLoader(that.loadProgressManager); @@ -289,7 +289,7 @@ VR.prototype.playPanorama=function (recUrl,recType,objName) { var phiStart = AVR.isMobileDevice()?Math.PI/2:-Math.PI/2; var geometry = geometry = new THREE.SphereBufferGeometry(this.vrbox.radius, this.vrbox.widthSegments, this.vrbox.heightSegments, phiStart); geometry.scale(-1, 1, 1); //x取反(面朝里) - if (that.recType.video == recType) { + if (that.resType.video == resType) { var video = AVR.createTag('video', { 'webkit-playsinline': true, diff --git a/docs/VRAPI.md b/docs/VRAPI.md index 41be07a..33d8205 100644 --- a/docs/VRAPI.md +++ b/docs/VRAPI.md @@ -11,8 +11,8 @@ 播放器类别指定 - vr.recType={"video":"video","box":"box","slice":"slice"}; - //全景视频则是vr.recType.video 正六面体为vr.recType.box 切片并补天播放器类别为vr.recType.slice + vr.resType={"video":"video","box":"box","slice":"slice"}; + //全景视频则是vr.resType.video 正六面体为vr.resType.box 切片并补天播放器类别为vr.resType.slice 初始化全景容器参数,如果全景图为正六面体则指定width、height、depth 3个参数,适用于box和slice类别; 如果为球体则设置radius、widthSegments、heightSegments ,适用于video和默认类别 @@ -69,7 +69,7 @@ /** * resource 全景资源地址 - * resourceType 全景资源类别vr.recType.[box/video/slice] + * resourceType 全景资源类别vr.resType.[box/video/slice] * objName 播放器对象name值 默认为 __panoContainer **/ vr.playPanorama(resource,resourceType,objName); diff --git a/examples/asteroid_view1.html b/examples/asteroid_view1.html index 914437e..3aa475d 100644 --- a/examples/asteroid_view1.html +++ b/examples/asteroid_view1.html @@ -69,7 +69,7 @@ //AVR.useGyroscope=false; vr.init(); - vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/360.mp4',vr.recType.video); + vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/360.mp4',vr.resType.video); vr.video.setAttribute("loop","loop"); vr.video.crossOrigin="Anonymous"; vr.video.autoplay=true; diff --git a/examples/auto_convert.html b/examples/auto_convert.html index c2afe9d..f2a1d31 100644 --- a/examples/auto_convert.html +++ b/examples/auto_convert.html @@ -44,7 +44,7 @@ vr.init(); vr.sphere2BoxPano("textures/puydesancy.jpg",1024,1024,function (img) { //document.getElementById("test").src=img; - vr.playPanorama(img,vr.recType.box); + vr.playPanorama(img,vr.resType.box); }); // diff --git a/examples/cubic_projection.html b/examples/cubic_projection.html index 3016805..54153fb 100644 --- a/examples/cubic_projection.html +++ b/examples/cubic_projection.html @@ -55,7 +55,7 @@ } vr.sphere2BoxPano("textures/puydesancy.jpg",1024,1024,function (sliceArray) { - vr.playPanorama(sliceArray, vr.recType.slice); + vr.playPanorama(sliceArray, vr.resType.slice); }); //vr.playPanorama("http://ov4hj29xx.bkt.clouddn.com/puydesancy.jpg"); diff --git a/examples/vr_cube.html b/examples/vr_cube.html index c31006a..9a3f16e 100644 --- a/examples/vr_cube.html +++ b/examples/vr_cube.html @@ -45,8 +45,8 @@ vr.VRObject.getObjectByName("__panoContainer").visible = true; } vr.init(); - vr.playPanorama("textures/sun_temple_stripe.jpg",vr.recType.box); - //vr.playPanorama("textures/aaa.png",vr.recType.box); + vr.playPanorama("textures/sun_temple_stripe.jpg",vr.resType.box); + //vr.playPanorama("textures/aaa.png",vr.resType.box); } init(); diff --git a/examples/vr_slice_pano.html b/examples/vr_slice_pano.html index eaf3d1f..83a8101 100644 --- a/examples/vr_slice_pano.html +++ b/examples/vr_slice_pano.html @@ -46,7 +46,7 @@ vr.VRObject.getObjectByName("__panoContainer").visible = true; } vr.sphere2BoxPano("http://ov4hj29xx.bkt.clouddn.com/puydesancy.jpg",1024,1024,function (sliceArray) { - vr.playPanorama(sliceArray, vr.recType.slice); + vr.playPanorama(sliceArray, vr.resType.slice); }); } init(); diff --git a/examples/vr_video.html b/examples/vr_video.html index 655ade7..fe3f28c 100644 --- a/examples/vr_video.html +++ b/examples/vr_video.html @@ -58,8 +58,8 @@ //AVR.useGyroscope=false; vr.init(); - vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/360.mp4',vr.recType.video); - //vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/panovideo/960p.mp4',vr.recType.video); + vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/360.mp4',vr.resType.video); + //vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/panovideo/960p.mp4',vr.resType.video); vr.video.setAttribute("loop","loop"); vr.video.crossOrigin="Anonymous"; vr.loadProgressManager.onLoad=function () { diff --git a/examples/vr_video1.html b/examples/vr_video1.html index 8ab8f5b..cce8d4a 100644 --- a/examples/vr_video1.html +++ b/examples/vr_video1.html @@ -58,7 +58,7 @@ //AVR.useGyroscope=false; vr.init(); - vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/360.mp4',vr.recType.video); + vr.playPanorama('http://ov4hj29xx.bkt.clouddn.com/360.mp4',vr.resType.video); vr.video.setAttribute("loop","loop"); vr.video.crossOrigin="Anonymous"; vr.loadProgressManager.onLoad=function () {