From: Vincent Vanwaelscappel Date: Mon, 20 Aug 2018 12:52:32 +0000 (+0200) Subject: wip #809 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=adc050742664af299b8e0ffaf01dfd766eb4102e;p=fluidbook-html5.git wip #809 @2 --- diff --git a/js/libs/fluidbook/fluidbook.3dflip.js b/js/libs/fluidbook/fluidbook.3dflip.js index 8c5a75b8..1fb45897 100644 --- a/js/libs/fluidbook/fluidbook.3dflip.js +++ b/js/libs/fluidbook/fluidbook.3dflip.js @@ -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); diff --git a/js/libs/fluidbook/fluidbook.support.js b/js/libs/fluidbook/fluidbook.support.js index ef2bb129..c16d110a 100644 --- a/js/libs/fluidbook/fluidbook.support.js +++ b/js/libs/fluidbook/fluidbook.support.js @@ -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;