Browse Source

增加小行星初始视觉

gemercheung 2 years ago
parent
commit
fd617c4501

+ 32 - 17
packages/qjkankan-view/public/showviewer/lib/krpano/skin/vtourskin.xml

@@ -284,8 +284,12 @@
 		  );
 
 		if(skin_settings.littleplanetintro AND (device.webgl OR device.flash),
-			if(get(skin_settings.lptswitch) == 1,skin_setup_littleplanetintro(skin_settings.littleplanetintro););
+			if(get(skin_settings.lptswitch) == 1,
+				set_default_lookat();
+			skin_setup_littleplanetintro(skin_settings.littleplanetintro);
+			);
 			if(get(skin_settings.lptswitch) == 0,
+				set_default_lookat();
 			   delayedcall(0.5,animationComplete);
 			);
 		  );
@@ -394,6 +398,7 @@
 
 
 	<action name="skin_setup_littleplanetintro">
+
 		copy(lp_scene, xml.scene);
 		copy(lp_hlookat, view.hlookat);
 		copy(lp_vlookat, view.vlookat);
@@ -401,6 +406,7 @@
 		copy(lp_fovmax, view.fovmax);
 		copy(lp_limitview, view.limitview);
 
+
     if(%1 == 1,
 				<!-- 小行星开场 -->
 			set(view.fovmax, 170);
@@ -415,10 +421,13 @@
 			copy(view.limitview, lp_limitview);
 			set(view.vlookatmin, null);
 			set(view.vlookatmax, null);
-							tween(view.hlookat|view.vlookat|view.fov|view.distortion, calc('' + lp_hlookat + '|' + lp_vlookat + '|' + lp_fov + '|' + 0.0),
+			tween(view.hlookat|view.vlookat|view.fov|view.distortion, calc('' + lp_hlookat + '|' + lp_vlookat + '|' + lp_fov + '|' + 0.0),
 			3.0, easeOutQuad,
-			animationComplete();
-			);); ););
+			animationComplete(););
+			<!-- tween(view.hlookat|view.vlookat|view.fov|view.distortion, calc('' + lp_hlookat + '|' + lp_vlookat + '|' + lp_fov + '|' + 0.0),
+			3.0, easeOutQuad,
+			animationComplete();); -->
+			); ););
 		);
 
     if(%1 == 2,
@@ -438,15 +447,15 @@
     if(%1 == 3,
 				<!-- 小行星巡游 -->
 			set(view.fov, 70);
-					set(view.vlookat, -40);
-					set(view.hlookat, get(lp_hlookat));
+			set(view.vlookat, -40);
+			set(view.hlookat, get(lp_hlookat));
 					
 			sub(view.hlookat, 360);
-					tween(view.vlookat, 90, 9, easeInOutSine);
-					delayedcall(animation2_0,2,
-							tween(view.hlookat, get(lp_hlookat), 7.5, easeInOutSine);
-							tween(view.fov, 150.0, 7.5, easeInOutSine);
-							delayedcall(animation2_1,7.6,
+			tween(view.vlookat, 90, 9, easeInOutSine);
+			delayedcall(animation2_0,2,
+			tween(view.hlookat, get(lp_hlookat), 7.5, easeInOutSine);
+			tween(view.fov, 150.0, 7.5, easeInOutSine);
+			delayedcall(animation2_1,7.6,
 			tween(view.fisheye, 0.0,3);
 									tween(view.vlookat, get(lp_vlookat), 3, easeInOutSine);
 									tween(view.fov, get(lp_fov), 3, easeInOutSine,
@@ -483,16 +492,18 @@
 						tween(view.hlookat, get(lp_hlookat), 9.5, easeInOutSine);
 						delayedcall(animation3_0,9.6,
 				tween(view.fisheye, 0.0,3);
-								tween(view.fov, get(lp_fov), 3, easeInOutSine,
-				animationComplete();
-				);
+				tween(view.fov, get(lp_fov), 3, easeInOutSine);
 				delayedcall(0.5, tween(view.vlookat, get(lp_vlookat), 2.5, easeInOutSine););
-						);
+				delayedcall(0.1,animationComplete(););
+				);
 		);
 
 	</action>
 
-
+	<action name="set_default_lookat">
+		set(view.vlookat,get(view.org_vlookat));
+		set(view.hlookat,get(view.org_hlookat));	
+	</action>
 	<action name="skin_lookat">
 		if(webvr.isenabled,
 									<!-- adjust the VR prev/next hotspots for the view change -->
@@ -1268,7 +1279,11 @@
 	<action name="animationComplete">
 			set(control.usercontrol, all);
 			js_sceneReadyCallback();
-
+			showlog();
+			trace('vlookat',get(view.vlookat));
+			trace('hlookat',get(view.hlookat));
+			trace('org_vlookat',get(view.org_vlookat));
+			trace('org_vlookat',get(view.org_hlookat));
 					<!-- setup_pano_settings();
 			setup_global_settings();
 			js_sceneReadyCallback();

+ 3 - 1
packages/qjkankan-view/src/components/Pano/index.vue

@@ -34,6 +34,8 @@ const hadGetInfo = ref(false);
 
 const loadScene = async (currentScene) => {
   let app = await getApp();
+  // await new Promise((r) => setTimeout(r, 10000));
+  console.error("loadScene",unref(currentScene).initVisual);
   if (app.krpanoDom) {
     let { sceneCode, initVisual, someData } = currentScene;
     app.krpanoDom.call(
@@ -171,7 +173,7 @@ useApp().then((app) => {
         console.log("click", hotspot);
         store.commit("functions/setPauseFrom", "");
         if (hotspot.hotspotType == "phone" && unref(isMobile)) {
-          window.open(`tel:${hotspot.phoneInfo.phone}`, '_self');
+          window.open(`tel:${hotspot.phoneInfo.phone}`, "_self");
           return;
         }
         if (hotspot.hotspotType == "scene") {

+ 6 - 0
packages/qjkankan-view/src/pages/show.vue

@@ -176,6 +176,12 @@ onMounted(async () => {
       isHavePano,
       vars: {
         startscene: "scene_" + currentScene.value.sceneCode,
+        "view.org_vlookat": currentScene.value.initVisual
+          ? currentScene.value.initVisual.vlookat
+          : 0,
+        "view.org_hlookat": currentScene.value.initVisual
+          ? currentScene.value.initVisual.hlookat
+          : 0,
         "view.vlookat": currentScene.value.initVisual
           ? currentScene.value.initVisual.vlookat
           : 0,

+ 2 - 2
packages/qjkankan-view/src/pages/showMobile.vue

@@ -173,10 +173,10 @@ onMounted(async () => {
       isHavePano,
       vars: {
         startscene: "scene_" + currentScene.value.sceneCode,
-        "view.vlookat": currentScene.value.initVisual
+        "view.org_vlookat": currentScene.value.initVisual
           ? currentScene.value.initVisual.vlookat
           : 0,
-        "view.hlookat": currentScene.value.initVisual
+        "view.org_hlookat": currentScene.value.initVisual
           ? currentScene.value.initVisual.hlookat
           : 0,
         "autorotate.enabled": !!data.isAuto,