|
@@ -2658,17 +2658,10 @@ export class Viewer extends ViewerBase{
|
|
|
}
|
|
|
|
|
|
|
|
|
- updateVisible(object, reason, ifShow, force){//当所有加入的条件都不为false时才显示. reason='force'一般是强制、临时的
|
|
|
+ /* updateVisible(object, reason, ifShow, force){//当所有加入的条件都不为false时才显示. reason='force'一般是强制、临时的
|
|
|
if(!object.unvisibleReasons) object.unvisibleReasons = []; //如果length>0代表不可见
|
|
|
if(!object.forceVisibleReasons) object.forceVisibleReasons = []; //只要有一项代表一定可见,优先级比unvisibleReasons高
|
|
|
-
|
|
|
- /* let mapChange = ()=>{//还是算了,有时候可见性的改变 在mapViewer和mainViewer中交替,如reticule,就会频繁
|
|
|
- var layers = ['measure','map','mapObjects','bothMapAndScene']
|
|
|
- if(layers.some(e=> object.layers && (object.layers.mask == Potree.config.renderLayers[e]) )) {
|
|
|
- this.mapViewer.dispatchEvent({type:'content_changed'})
|
|
|
- }
|
|
|
- } */
|
|
|
-
|
|
|
+
|
|
|
if(ifShow){
|
|
|
if(force){
|
|
|
object.forceVisibleReasons.includes(reason) || object.forceVisibleReasons.push(reason)
|
|
@@ -2726,12 +2719,83 @@ export class Viewer extends ViewerBase{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ } */
|
|
|
+
|
|
|
+
|
|
|
+ updateVisible(object, reason, ifShow, level=0, type){//当所有加入的条件都不为false时才显示. reason='force'一般是强制、临时的
|
|
|
+ if(!object.unvisibleReasons) object.unvisibleReasons = []; //如果length>0代表不可见
|
|
|
+ if(!object.visibleReasons) object.visibleReasons = []; //在同级时,优先可见
|
|
|
+
|
|
|
+
|
|
|
+ var update = function(){
|
|
|
+
|
|
|
+ //先按从高到低的level排列
|
|
|
+ object.unvisibleReasons = object.unvisibleReasons.sort((a,b)=>b.level-a.level)
|
|
|
+ object.visibleReasons = object.visibleReasons.sort((a,b)=>b.level-a.level)
|
|
|
+ var maxVisiLevel = object.visibleReasons[0] ? object.visibleReasons[0].level : -1
|
|
|
+ var maxunVisiLevel = object.unvisibleReasons[0] ? object.unvisibleReasons[0].level : -1
|
|
|
+
|
|
|
+ var shouldVisi = maxVisiLevel >= maxunVisiLevel
|
|
|
+ var visiBefore = object.visible
|
|
|
+
|
|
|
+
|
|
|
+ if(visiBefore != shouldVisi){
|
|
|
+ object.visible = shouldVisi
|
|
|
+ object.dispatchEvent({
|
|
|
+ type: 'isVisible',
|
|
|
+ visible: shouldVisi,
|
|
|
+ reason,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(ifShow){
|
|
|
+
|
|
|
+ var index = object.unvisibleReasons.findIndex(e=>e.reason == reason)
|
|
|
+ if(index > -1){
|
|
|
+ type = 'cancel'
|
|
|
+ object.unvisibleReasons.splice(index, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(type == 'add' ){
|
|
|
+ if(!object.visibleReasons.some(e=>e.reason == reason)){
|
|
|
+ object.visibleReasons.push({reason,level})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ var index = object.visibleReasons.findIndex(e=>e.reason == reason)
|
|
|
+ if(index > -1){
|
|
|
+ type = 'cancel'
|
|
|
+ object.visibleReasons.splice(index, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(type != 'cancel' ){
|
|
|
+ if(!object.unvisibleReasons.some(e=>e.reason == reason)){
|
|
|
+ object.unvisibleReasons.push({reason,level})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ update()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
getObjVisiByReason(object,reason){//获取在某条件下是否可见. 注: 用户在数据集选择可不可见为"datasetSelection"
|
|
|
if(object.visible)return true
|
|
|
else{
|
|
|
- return !object.unvisibleReasons || !object.unvisibleReasons.includes(reason)
|
|
|
+ return !object.unvisibleReasons || !object.unvisibleReasons.some(e=>e.reason == reason)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3043,7 +3107,7 @@ export class Viewer extends ViewerBase{
|
|
|
this.images360.removeEventListener('cameraMoveDone',f)
|
|
|
}
|
|
|
this.images360.addEventListener('cameraMoveDone',f)
|
|
|
- return {promise: deferred.promise() }();
|
|
|
+ return {promise: deferred.promise() }
|
|
|
}
|
|
|
if (type == 'measure') {
|
|
|
target.copy(object.getCenter())
|
|
@@ -3556,7 +3620,20 @@ export class Viewer extends ViewerBase{
|
|
|
viewer.inputHandler.toggleSelection(object);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ pointInWhichPointcloud(pos){//选择最接近中心的那个 使用boundSphere
|
|
|
+ let result = Common.sortByScore(this.scene.pointclouds,[],[
|
|
|
+ (pointcloud)=>{
|
|
|
+ var size = pointcloud.pcoGeometry.tightBoundingBox.getSize(new THREE.Vector3)
|
|
|
+ var center = pointcloud.bound.getCenter(new THREE.Vector3)
|
|
|
+ var length = size.length()
|
|
|
+ var dis = pos.distanceTo(center);
|
|
|
+ return length / dis //到数据集中心的距离占数据集大小越小越好
|
|
|
+ }
|
|
|
+ ])
|
|
|
+ //若要求更准确的话,可以使用ifContainsPoint判断一下是否在bound中
|
|
|
+ let r = result && result[0];
|
|
|
+ return r.score > 1 ? result[0].item : null
|
|
|
+ }
|
|
|
|
|
|
/* addObjectTest1(){//加水管
|
|
|
|
|
@@ -3756,9 +3833,402 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
|
|
|
|
|
|
+ addVideo11(){
|
|
|
+ if(Potree.settings.number != 'SS-fckI7CClKC')return
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var video = $(`<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>`)[0]
|
|
|
+ video.setAttribute("crossOrigin", 'Anonymous')
|
|
|
+ //video.src = Potree.resourcePath+'/video/SS-fckI7CClKC/19.mp4'
|
|
|
+
|
|
|
+ var map = new THREE.VideoTexture(video);
|
|
|
+ var plane = this.videoPlane = new THREE.Mesh(new THREE.PlaneGeometry(1, 1, 1, 1), new THREE.MeshBasicMaterial({
|
|
|
+ color:"#ffffff",
|
|
|
+ transparent: !0,
|
|
|
+ depthTest:false,
|
|
|
+ opacity:0.7,
|
|
|
+ side:2,
|
|
|
+ map
|
|
|
+ }))
|
|
|
+ plane.visible = false
|
|
|
+
|
|
|
+ plane.geometry.computeBoundingBox();
|
|
|
+ plane.boundingBox = plane.geometry.boundingBox.clone()//.applyMatrix4()
|
|
|
+ plane.boundingBox.max.z = 1
|
|
|
+ plane.boundingBox.max.y = -0.4
|
|
|
+ plane.boundingBox.max.x = 1
|
|
|
+
|
|
|
+ /* plane.position.copy(this.images360.panos[19].position);
|
|
|
+ plane.lookAt(plane.position.clone().setX(0))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 9:
|
|
|
+ viewer.videoPlane.rotation.set(-1.432978005954197, 1.2296264545169697, 3.0098547630197667)
|
|
|
+ viewer.videoPlane.position.set( 6.532456676287381, -9.806373049095631, -0.024205281024294284)
|
|
|
+ //viewer.transformObject(viewer.videoPlane)
|
|
|
+
|
|
|
+ //19:
|
|
|
+ viewer.videoPlane.rotation.set( 1.627167773445286, -1.172425902600188, 0.04682299709711613)
|
|
|
+ viewer.videoPlane.position.set( -9.558613948539932,-1.042301166581578, 0.08159683876743667) */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ video.addEventListener('loadeddata', function(e) {
|
|
|
+ video.play()
|
|
|
+ //plane.scale.set(video.videoWidth/1000,video.videoHeight/1000,1) // 1080 * 1920
|
|
|
+ console.log('video loadeddata')
|
|
|
+ })
|
|
|
+
|
|
|
+ plane.scale.set(1080/1000,1920/1000,1) // 1080 * 1920
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var startPlay = ()=>{
|
|
|
+ video.play()
|
|
|
+ //video.pause()
|
|
|
+ //video.currentTime = 0.1;
|
|
|
+ this.removeEventListener('global_mousedown', startPlay)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.addEventListener('global_mousedown', startPlay)
|
|
|
+
|
|
|
+
|
|
|
+ var videoInfo = {
|
|
|
+ 9:{
|
|
|
+ rotation:[-1.432978005954197, 1.2296264545169697, 3.0098547630197667],
|
|
|
+ position:[6.532456676287381, -9.806373049095631, -0.024205281024294284]
|
|
|
+ },
|
|
|
+ 19:{
|
|
|
+ rotation:[1.627167773445286, -1.172425902600188, 0.04682299709711613],
|
|
|
+ position:[-9.558613948539932,-1.042301166581578, 0.08159683876743667]
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ /* this.images360.addEventListener('cameraMoveDone',(e)=>{
|
|
|
+ let info = videoInfo[this.images360.currentPano.id]
|
|
|
+ if(info ){
|
|
|
+ plane.visible = true;
|
|
|
+ plane.material.opacity = 1;
|
|
|
+ plane.position.fromArray(info.position)
|
|
|
+ plane.rotation.fromArray(info.rotation)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }) */
|
|
|
+
|
|
|
+
|
|
|
+ this.images360.addEventListener('flyToPano' ,(e)=>{//飞之前
|
|
|
+ if(Potree.settings.displayMode != 'showPanos') return
|
|
|
+ let info = videoInfo[e.toPano.pano.id]
|
|
|
+ if(info ){ //出现
|
|
|
+ setTimeout(()=>{
|
|
|
+ plane.visible = true;
|
|
|
+ plane.position.fromArray(info.position)
|
|
|
+ plane.rotation.fromArray(info.rotation)
|
|
|
+
|
|
|
+ video.src = Potree.resourcePath+`/video/${Potree.settings.number}/${e.toPano.pano.id}.mp4`
|
|
|
+ video.play();
|
|
|
+ video.currentTime = 0
|
|
|
+ Potree.settings.zoom.enabled = false
|
|
|
+
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 1/* , (e)=>{console.log('fadeIn',e)} */) , e.toPano.duration*0.4 , ()=>{
|
|
|
+
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+ }, e.toPano.duration*0.6) //时间上不能和消失的重叠 延迟
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //消失
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 0, /* (e)=>{console.log('fadeOut',e)} */) , e.toPano.duration*0.4, ()=>{
|
|
|
+ if(!info){
|
|
|
+ plane.visible = false
|
|
|
+ video.pause()
|
|
|
+ Potree.settings.zoom.enabled = true
|
|
|
+ }
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.images360.addEventListener('endChangeMode',(e)=>{ //暂时不处理初始加载时就在有视频的点位上的情况
|
|
|
+ if(e.mode == 'showPanos'){
|
|
|
+ let info = videoInfo[this.images360.currentPano.id]
|
|
|
+ if(info ){ //出现
|
|
|
+ plane.visible = true;
|
|
|
+ plane.position.fromArray(info.position)
|
|
|
+ plane.rotation.fromArray(info.rotation)
|
|
|
+ plane.material.opacity = 0
|
|
|
+
|
|
|
+ video.src = Potree.resourcePath+`/video/${Potree.settings.number}/${this.images360.currentPano.id}.mp4`
|
|
|
+ video.play();
|
|
|
+ video.currentTime = 0
|
|
|
+ Potree.settings.zoom.enabled = false
|
|
|
+
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 1, (e)=>{console.log('fadeIn',e)}) , 300 , ()=>{
|
|
|
+
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ plane.visible = false;
|
|
|
+ Potree.settings.zoom.enabled = true
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ this.scene.scene.add(plane)
|
|
|
+ }
|
|
|
+ ////////////////////////
|
|
|
|
|
|
+ addVideo(){
|
|
|
+ if(Potree.settings.number != 'SS-t-P6zBR73Gke')return
|
|
|
+ var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
|
|
|
+
|
|
|
+ var videoInfo = this.videoInfo = [
|
|
|
+ /* {
|
|
|
+ id: 45,
|
|
|
+ url: 'https://laser-oss.4dkankan.com/testdata/SS-t-P6zBR73Gke/temp/poi/2022/05/09/c02a2c1e-8420-4f34-b951-5f7a07abe932.mp4',
|
|
|
+ rotation:[-1.629007730553656, 0.042029565584517974, -3.1345506775116627],
|
|
|
+ position:[ 9.467649296794061, -0.7596961214872837, -0.12477576310191862],
|
|
|
+ scale:[4.52209111454416,3.3888400031207984,1],
|
|
|
+
|
|
|
+ }, */
|
|
|
+
|
|
|
+ {
|
|
|
+ id: '40-2',
|
|
|
+ url: 'https://laser-oss.4dkankan.com/testdata/SS-t-P6zBR73Gke/temp/poi/2022/05/10/0aabafee-36b8-455d-9c11-0780bf694786.mp4',
|
|
|
+ rotation:[-1.494468618954883, -1.4987317433158989, -3.061254983446741],
|
|
|
+ position:[ 19.801820617361624, 2.884673619844108, -0.03362305858221648],
|
|
|
+ scale:[3.5741423153151763, 2.8738725275578703, 1],
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ id: 40,
|
|
|
+ /* rotation:[-1.534692822378723, 0.01083403560862361, 3.141535283661569],
|
|
|
+ position:[17.2934294239949861, 2.413510747928117, -0.008057029580231356], */
|
|
|
+ url: 'https://laser-oss.4dkankan.com/testdata/SS-t-P6zBR73Gke/temp/poi/2022/05/09/7896d6ef-a2d6-4fd7-949c-768782a5b484.mp4',
|
|
|
+
|
|
|
+ rotation:[-1.5487684197910518, 0.021848470169552752, -3.1387534893955236],
|
|
|
+ position:[17.277316608096, 2.0840432922115846, -0.0931149415437065],
|
|
|
+ scale:[2.0821757723834047, 0.6129478480765236, 1],
|
|
|
+ visibles: [40]
|
|
|
+ },
|
|
|
+
|
|
|
+ ]
|
|
|
+ let add = (info)=>{
|
|
|
+ var video = $(`<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>`)[0]
|
|
|
+ video.setAttribute("crossOrigin", 'Anonymous')
|
|
|
+ video.src = info.url || Potree.resourcePath+`/video/${Potree.settings.number}/${info.id}.mp4`
|
|
|
+
|
|
|
+ var map = new THREE.VideoTexture(video);
|
|
|
+ var plane = this.videoPlane = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({
|
|
|
+ color:"#ffffff",
|
|
|
+ transparent: !0,
|
|
|
+ depthTest:false,
|
|
|
+ opacity:0 ,
|
|
|
+ //side:2,
|
|
|
+ map
|
|
|
+ }))
|
|
|
+ plane.position.fromArray(info.position)
|
|
|
+ plane.rotation.fromArray(info.rotation)
|
|
|
+ info.scale && plane.scale.fromArray(info.scale)
|
|
|
+ this.scene.scene.add(plane)
|
|
|
+ info.plane = plane
|
|
|
+ plane.boundingBox = new THREE.Box3(new THREE.Vector3(0,-0.5,0),new THREE.Vector3(1,-0.4,0.2))
|
|
|
+ video.addEventListener('loadeddata', function(e) {
|
|
|
+ video.play()
|
|
|
+ if(!info.visibles/* ||!viewer.images360.currentPano || info.visibles.includes(viewer.images360.currentPano.id) */){
|
|
|
+ plane.material.opacity = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ info.scale || plane.scale.set(video.videoWidth/1000,video.videoHeight/1000,1) // 1080 * 1920
|
|
|
+ console.log('video loadeddata', info.id)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(info.visibles){
|
|
|
+ this.images360.addEventListener('flyToPano' ,(e)=>{//飞之前
|
|
|
+ if(info.visibles.includes(e.toPano.pano.id)){ //出现
|
|
|
+ setTimeout(()=>{
|
|
|
+ plane.visible = true;
|
|
|
+
|
|
|
+ video.play();
|
|
|
+ video.currentTime = 0
|
|
|
+ Potree.settings.zoom.enabled = false
|
|
|
+
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 1 ) , e.toPano.duration*0.4 , ()=>{
|
|
|
+
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+ }, e.toPano.duration*0.6) //时间上不能和消失的重叠 延迟
|
|
|
+
|
|
|
+ }else{
|
|
|
+ //消失
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 0, ) , e.toPano.duration*0.4, ()=>{
|
|
|
+ if(!info){
|
|
|
+ plane.visible = false
|
|
|
+ video.pause()
|
|
|
+ Potree.settings.zoom.enabled = true
|
|
|
+ }
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var startPlay = ()=>{
|
|
|
+ video.play()
|
|
|
+ //video.pause()
|
|
|
+ //video.currentTime = 0.1;
|
|
|
+ this.removeEventListener('global_mousedown', startPlay)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.addEventListener('global_mousedown', startPlay)
|
|
|
+ Potree.settings.isTest && plane.addEventListener('select',(e)=>{console.log(e)})
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ videoInfo.forEach(info=>{
|
|
|
+ add(info)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ /* var video = $(`<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>`)[0]
|
|
|
+ video.setAttribute("crossOrigin", 'Anonymous')
|
|
|
+ video.src = Potree.resourcePath+'/video/SS-t-P6zBR73Gke/40.mp4'
|
|
|
+
|
|
|
+ var map = new THREE.VideoTexture(video);
|
|
|
+ var plane = this.videoPlane = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({
|
|
|
+ color:"#ffffff",
|
|
|
+ transparent: !0,
|
|
|
+ depthTest:false,
|
|
|
+ opacity:0.7,
|
|
|
+ side:2,
|
|
|
+ map
|
|
|
+ }))
|
|
|
+ //plane.visible = false
|
|
|
+ this.scene.scene.add(plane)
|
|
|
+ plane.geometry.computeBoundingBox();
|
|
|
+ plane.boundingBox = plane.geometry.boundingBox.clone()//.applyMatrix4()
|
|
|
+ plane.boundingBox.max.z = 0.3
|
|
|
+ plane.boundingBox.max.y = -0.4
|
|
|
+ plane.boundingBox.max.x = 1
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ plane.position.copy(this.images360.panos[40].position);
|
|
|
+ plane.lookAt(plane.position.clone().setX(0))
|
|
|
+
|
|
|
+
|
|
|
+ plane.rotation.set(-1.534692822378723, 0.01083403560862361, 3.141535283661569)
|
|
|
+ plane.position.set( 17.2934294239949861, 2.413510747928117, -0.008057029580231356)
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+ //viewer.transformObject(viewer.videoPlane)
|
|
|
+
|
|
|
+ //19:
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ video.addEventListener('loadeddata', function(e) {
|
|
|
+ video.play()
|
|
|
+ plane.scale.set(video.videoWidth/1000,video.videoHeight/1000,1) // 1080 * 1920
|
|
|
+ console.log('video loadeddata')
|
|
|
+ })
|
|
|
+
|
|
|
+ //plane.scale.set(1080/1000,1920/1000,1) // 1080 * 1920
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var startPlay = ()=>{
|
|
|
+ video.play()
|
|
|
+ //video.pause()
|
|
|
+ //video.currentTime = 0.1;
|
|
|
+ this.removeEventListener('global_mousedown', startPlay)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.addEventListener('global_mousedown', startPlay)
|
|
|
+
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /* this.images360.addEventListener('flyToPano' ,(e)=>{//飞之前
|
|
|
+ if(Potree.settings.displayMode != 'showPanos') return
|
|
|
+ let info = videoInfo[e.toPano.pano.id]
|
|
|
+ if(info ){ //出现
|
|
|
+ setTimeout(()=>{
|
|
|
+ plane.visible = true;
|
|
|
+ plane.position.fromArray(info.position)
|
|
|
+ plane.rotation.fromArray(info.rotation)
|
|
|
+
|
|
|
+ video.src = Potree.resourcePath+`/video/${Potree.settings.number}/${e.toPano.pano.id}.mp4`
|
|
|
+ video.play();
|
|
|
+ video.currentTime = 0
|
|
|
+ Potree.settings.zoom.enabled = false
|
|
|
+
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 1 ) , e.toPano.duration*0.4 , ()=>{
|
|
|
+
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+ }, e.toPano.duration*0.6) //时间上不能和消失的重叠 延迟
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //消失
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 0, ) , e.toPano.duration*0.4, ()=>{
|
|
|
+ if(!info){
|
|
|
+ plane.visible = false
|
|
|
+ video.pause()
|
|
|
+ Potree.settings.zoom.enabled = true
|
|
|
+ }
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.images360.addEventListener('endChangeMode',(e)=>{ //暂时不处理初始加载时就在有视频的点位上的情况
|
|
|
+ if(e.mode == 'showPanos'){
|
|
|
+ let info = videoInfo[this.images360.currentPano.id]
|
|
|
+ if(info ){ //出现
|
|
|
+ plane.visible = true;
|
|
|
+ plane.position.fromArray(info.position)
|
|
|
+ plane.rotation.fromArray(info.rotation)
|
|
|
+ plane.material.opacity = 0
|
|
|
+
|
|
|
+ video.src = Potree.resourcePath+`/video/${Potree.settings.number}/${this.images360.currentPano.id}.mp4`
|
|
|
+ video.play();
|
|
|
+ video.currentTime = 0
|
|
|
+ Potree.settings.zoom.enabled = false
|
|
|
+
|
|
|
+ transitions.start(lerp.property(plane.material, "opacity", 1, (e)=>{console.log('fadeIn',e)}) , 300 , ()=>{
|
|
|
+
|
|
|
+ }, 0, easing['easeInOutQuad'])
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ plane.visible = false;
|
|
|
+ Potree.settings.zoom.enabled = true
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ */
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|