فهرست منبع

Merge pull request #4239 from RaananW/ufo-animation

Ufo animation
Raanan Weber 7 سال پیش
والد
کامیت
919f6f3d7e

+ 4 - 0
Viewer/assets/templates/default/defaultTemplate.html

@@ -9,7 +9,10 @@
     .icon {
         font-family: "babylon";
     }
+</style>
 
+{{#if fillScreen}}
+<style>
     html,
     body {
         width: 100%;
@@ -19,5 +22,6 @@
         padding: 0;
     }
 </style>
+{{/if}}
 
 <fill-container></fill-container>

+ 0 - 1
Viewer/assets/templates/default/defaultViewer.html

@@ -3,7 +3,6 @@
         position: relative;
         overflow: hidden;
         /* Start stage */
-        flex: 1;
         z-index: 1;
         justify-content: center;
         align-items: center;

+ 1 - 8
Viewer/dist/ufoExample.html

@@ -6,17 +6,10 @@
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <meta http-equiv="X-UA-Compatible" content="ie=edge">
         <title>BabylonJS Viewer - UFO</title>
-        <style>
-            babylon,
-            #viewport {
-                /*max-width: 900px;
-                max-height: 600px;*/
-            }
-        </style>
     </head>
 
     <body>
-        <babylon extends="default, shadowDirectionalLight, environmentMap" templates.nav-bar.params.disable-on-fullscreen="true">
+        <babylon extends="default, shadowDirectionalLight, environmentMap" templates.main.params.fill-screen="true">
             <scene glow="true">
             </scene>
             <lab>

+ 6 - 4
Viewer/src/viewer/defaultViewer.ts

@@ -242,11 +242,13 @@ export class DefaultViewer extends AbstractViewer {
             newParams.animations = this._animationList;
             newParams.paused = this._isAnimationPaused;
             let animationIndex = 0;
-            if (model.configuration.animation && model.configuration.animation.autoStartIndex) {
-                animationIndex = model.configuration.animation.autoStartIndex;
+            if (model.configuration.animation && typeof model.configuration.animation.autoStart === 'string') {
+                animationIndex = animationNames.indexOf(model.configuration.animation.autoStart);
+                if (animationIndex === -1) {
+                    animationIndex = 0;
+                }
             }
-            this._updateAnimationSpeed("1.0", newParams);
-            this._updateAnimationType(animationNames[animationIndex]);
+            this._updateAnimationType(animationNames[animationIndex], newParams);
         }
 
         if (model.configuration.thumbnail) {