Browse Source

水下地形修改

gr 1 year ago
parent
commit
c7812f1f70
3 changed files with 23 additions and 8 deletions
  1. 1 0
      src/components/UeVideo.vue
  2. 9 2
      src/utils/UIInteractions.js
  3. 13 6
      src/views/home/cpns/UnderWater.vue

+ 1 - 0
src/components/UeVideo.vue

@@ -26,6 +26,7 @@ export default {
       videoInstance = initLoad({
         context,
         serverUrl: 'http://172.16.58.195:8080/',
+        // serverUrl: 'http://172.16.58.198:8080/',
         autoConnection: true,
         showPlayOverlay: false,
         qualityControl: true,

+ 9 - 2
src/utils/UIInteractions.js

@@ -279,11 +279,11 @@ export function ueCallOpenWater() {    // 打开水面
   })
 }
 
-export function ueCallChangeShuishen(shuishen_index) {    // 水下地形切换
+export function ueCallChangeShuishen(shuishen_index, type='') {    // 水下地形切换
   callUIInteractionFormat({
     "ActionName":"change_shuishen",
     "Parameters": {
-      shuishen_index
+      shuishen_index, type
     }
   })
 }
@@ -396,6 +396,13 @@ export function ueCallFlyToSXDXNew() {    // 定位到水下地形视角
   })
 }
 
+export function ueCallFlyToSXDXStretch() {    // 定位到水下地形拉伸视角(todo
+  callUIInteractionFormat({
+    "ActionName":"fly",
+    "Parameters":{ "x":211334.953125,"y":-85456.367188,"z":-4260.189453,"roll_x":0,"roll_y":-20.781706,"roll_z":-55.283707}
+  })
+}
+
 export function ueCallFlyToSXDX() {    // 定位到水下地形水上视角新加
   callUIInteractionFormat({
     "ActionName":"fly",

+ 13 - 6
src/views/home/cpns/UnderWater.vue

@@ -42,7 +42,7 @@ import { ElCarousel, ElCarouselItem } from 'element-plus'
 import 'element-plus/es/components/carousel/style/css'
 import 'element-plus/es/components/carousel-item/style/css'
 import { useNow, useDateFormat } from '@vueuse/core'
-import { ueCallCloseWater, ueCallOpenWater, ueCallChangeShuishen, ueCallFlyToSXDX, ueCallFlyToSXDXNew, ueCallChangeTime, ueCallGetNowTime } from '@/utils/UIInteractions'
+import { ueCallCloseWater, ueCallOpenWater, ueCallChangeShuishen, ueCallFlyToSXDX, ueCallFlyToSXDXNew, ueCallFlyToSXDXStretch, ueCallChangeTime, ueCallGetNowTime } from '@/utils/UIInteractions'
 import bus from '@/utils/bus'
 
 
@@ -53,7 +53,7 @@ onMounted(() => {
   setTimeout(() => {
     ueCallChangeTime(18)
     ueCallCloseWater()
-    ueCallChangeShuishen('2023.1')
+    ueCallChangeShuishen('2023.1', currentType.value)
   }, 2000);
 })
 
@@ -99,11 +99,11 @@ function handleSxdxScroll(type) {
 function handleChooseSxdx(i, type) {
   if(type==='.1'&&i.usable1) {
     sxdxCurrent.value = i.year+'.1'
-    ueCallChangeShuishen(sxdxCurrent.value)
+    ueCallChangeShuishen(sxdxCurrent.value, currentType.value)
   }
   if(type==='.2'&&i.usable2) {
     sxdxCurrent.value = i.year+'.2'
-    ueCallChangeShuishen(sxdxCurrent.value)
+    ueCallChangeShuishen(sxdxCurrent.value, currentType.value)
   }
   if(i.year===2022&&type==='.2') {
     bus.emit('changeYuJiNum', 1)
@@ -119,7 +119,12 @@ const currentView = ref('up')
 // 切换视角
 function handleChangeView() {
   if(currentView.value==='up') {
-    ueCallFlyToSXDXNew()
+    if(currentType==='lashen') {
+      // 拉伸视角
+      ueCallFlyToSXDXStretch()
+    } else {
+      ueCallFlyToSXDXNew()
+    }
     currentView.value = 'down'
   } else {
     ueCallFlyToSXDX()
@@ -127,9 +132,11 @@ function handleChangeView() {
   }
 }
 
+const currentType = ref('lashen')
+
 // 切换类型
 function handleChangeType() {
-
+  currentType.value = currentType.value==='lashen'? 'pingmian': 'lashen'
 }