success: function (data) {
$this.benchmark = parseInt(data);
cb();
- }, error: function () {
+ },
+ error: function () {
cb();
}
});
this.container = $(this.jcontainer).get(0);
- var mode;
- if ($_GET['performance'] == null) {
- mode = 'performancesTest';
- } else {
- var map = {1: 'highPerf', 2: 'lowPerf', 3: 'veryLowPerf'};
- mode = map[$_GET['performance']];
+ var mode = this.fluidbook.settings.performance3DMode;
+ if (mode===undefined || mode===null || mode === 'auto') {
+ if ($_GET['performance'] == null) {
+ mode = 'performancesTest';
+ } else {
+ var map = {1: 'highPerf', 2: 'lowPerf', 3: 'veryLowPerf'};
+ mode = map[$_GET['performance']];
+ }
}
this.init3D(mode);
if (this.enableShadow) {
geometry = new THREE.PlaneGeometry(this.fluidbook.settings.width * this.geometryScale * 2, this.fluidbook.settings.height * this.geometryScale, 1, 1, true);
var shadowTexture = new THREE.ShadowMaterial({
- color: 0x000000,
- side: THREE.FrontSide,
- overdraw: 0.5,
- opacity: .1
+ color: 0x000000, side: THREE.FrontSide, overdraw: 0.5, opacity: .1
});
this.shadowPlane = new THREE.Mesh(geometry, [shadowTexture]);
this.shadowPlane.receiveShadow = true;
if (this.enableLight) {
meshSettings.roughness = roughness;
- this.textures = [
- new THREE.MeshStandardMaterial(meshSettings),
- new THREE.MeshStandardMaterial(meshSettings),
- ];
+ this.textures = [new THREE.MeshStandardMaterial(meshSettings), new THREE.MeshStandardMaterial(meshSettings),];
} else {
- this.textures = [
- new THREE.MeshBasicMaterial(meshSettings),
- new THREE.MeshBasicMaterial(meshSettings),
- ];
+ this.textures = [new THREE.MeshBasicMaterial(meshSettings), new THREE.MeshBasicMaterial(meshSettings),];
}
geometry.translate(this.fluidbook.settings.width * this.geometryScale * 0.5, 0, 0);
this.tlright = new TimelineMax();
this.tlright.add(TweenMax.fromTo(this.bend, .5, {force: 0}, {
- force: force * -1,
- ease: easeIn
+ force: force * -1, ease: easeIn
}));
this.tlright.add(TweenMax.fromTo(this.bend, .5, {force: force * -1}, {force: 0, ease: easeOut}));
this.tlright.add(TweenMax.fromTo(this, 1, {_pageRotation: -0}, {
- _pageRotation: -180,
- ease: easeIn
+ _pageRotation: -180, ease: easeIn
}), 0);
this.tlright.add(TweenMax.fromTo(this, 1, {_gapOffset: -0.5}, {_gapOffset: 1.2, ease: noease}), 0);
this.tlright.pause();
this.tlleft = new TimelineMax();
this.tlleft.add(TweenMax.fromTo(this.bend, .5, {force: 0}, {
- force: force,
- ease: easeIn
+ force: force, ease: easeIn
}));
this.tlleft.add(TweenMax.fromTo(this.bend, .5, {force: force}, {force: 0, ease: easeOut}));
this.tlleft.add(TweenMax.fromTo(this, 1, {_pageRotation: -180}, {
- _pageRotation: -0,
- ease: easeIn
+ _pageRotation: -0, ease: easeIn
}), 0);
this.tlleft.add(TweenMax.fromTo(this, 1, {_gapOffset: 1.2}, {_gapOffset: -0.5, ease: easeOut}), 0);
this.tlleft.pause();
delay = this.fluidbook.support.iOS ? 0.15 : 0.06;
}
- TweenMax.fromTo(this, this.animationTime * timeScale,
- {progressAnimation: 0,},
- {
- progressAnimation: 1,
- ease: Power0.easeIn,
- delay: delay,
- onStart: function () {
- if ($this.performancesTestRunning) {
- $this.performancesStartTime = new Date();
- }
- },
- onComplete: function () {
- this.tlname = '';
- callback();
- setTimeout(function () {
- $this.turnRunning = false;
- }, 5);
- //$this._callbackAfterNextRender = callback;
+ TweenMax.fromTo(this, this.animationTime * timeScale, {progressAnimation: 0,}, {
+ progressAnimation: 1, ease: Power0.easeIn, delay: delay, onStart: function () {
+ if ($this.performancesTestRunning) {
+ $this.performancesStartTime = new Date();
}
+ }, onComplete: function () {
+ this.tlname = '';
+ callback();
+ setTimeout(function () {
+ $this.turnRunning = false;
+ }, 5);
+ //$this._callbackAfterNextRender = callback;
}
- );
+ });
},
animate: function (next) {
vector.y = -(vector.y * heightHalf) + heightHalf;
return {
- x: vector.x,
- y: vector.y
+ x: vector.x, y: vector.y
};
},