]> _ Git - fluidbook-html5.git/commitdiff
wip #809 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 20 Aug 2018 12:52:32 +0000 (14:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 20 Aug 2018 12:52:32 +0000 (14:52 +0200)
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/fluidbook/fluidbook.support.js

index 8c5a75b8f04f23e1cc76f85e25b7bd2a7d9c2544..1fb45897552835ae9b6f740c1a055cd78e294f44 100644 (file)
@@ -16,16 +16,28 @@ function Fluidbook3DFlip(fluidbook) {
     this._progressAnimation = 0;
     this._pageRotation = 0;
     this.ready = false;
-    this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration);
+
     this.textures = [];
 
     // Performance settings
-    this.lowPerf = this.fluidbook.support.android || this.fluidbook.support.iOS || this.fluidbook.support.IE > 0;
+    this.veryLowPerf = this.fluidbook.support.IE > 0;
+    this.lowPerf = this.veryLowPerf || this.fluidbook.support.android || this.fluidbook.support.iOS || this.fluidbook.support.edge;
     this.enableLight = !this.lowPerf;
     this.enableShadow = !this.lowPerf && this.enableLight;
     this.antialias = false;
-    this.qualityRatio = this.lowPerf ? 1 : 2;
-    this.triangles = this.lowPerf ? 2 : 5;
+    if (this.veryLowPerf) {
+        this.qualityRatio = .7;
+        this.triangles = 1;
+        this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration) / 1.5;
+    } else if (this.lowPerf) {
+        this.qualityRatio = 1.2;
+        this.triangles = 2;
+        this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration) / 1.25;
+    } else {
+        this.qualityRatio = 2;
+        this.triangles = 5;
+        this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration);
+    }
     this.pixelRatio = window.devicePixelRatio * this.qualityRatio;
 
     this.jcontainer = $("#flip3dcontainer");
@@ -323,7 +335,7 @@ Fluidbook3DFlip.prototype = {
 
         this.sizePlane.scale.x = this.sizePlane.scale.y = 1;
 
-        for (var i = 0; i < 5; i++) {
+        for (var i = 0; i < 25; i++) {
             var bbox = new THREE.Box3().setFromObject(this.sizePlane);
             var min = this.to2D(bbox.min);
             var max = this.to2D(bbox.max);
index ef2bb1295cd0b229894417bba16ce95b3d446fae..c16d110a29dd873dfd8b0d299d0419695442bf80 100644 (file)
@@ -10,6 +10,7 @@ function FluidbookSupport(fluidbook) {
     this.android = this.fitScreenAtZero = this.userAgent.search(/android/i) > -1 || this.userAgent.search(/galaxy/i) > -1;
     this.android3 = this.android && this.userAgent.search(/android 3/i) > -1;
     this.iOS = this.userAgent.search(/ipad/i) > -1 || this.userAgent.search(/iphone/i) > -1 || this.userAgent.search(/ipod/i) > -1;
+    this.edge = this.userAgent.search(/edge/i) > -1;
     // If in node-webkit or if the index.html fluidbook is locally open in a browser
     this.offline = (typeof process !== "undefined" && process.versions['node-webkit']) || window.location.toString().indexOf("file://") == 0;
 
@@ -28,7 +29,6 @@ function FluidbookSupport(fluidbook) {
             break;
     }
 
-
     this.transitions2d = Modernizr.csstransforms && Modernizr.csstransitions;
     this.transitions3d = this.transitions2d && Modernizr.csstransforms3d && Modernizr.preserve3d;
     this.transitions3dacc = this.transitions2d && Modernizr.webgl;