From 53b894ff33316c1621c747b13440a000808abcfe Mon Sep 17 00:00:00 2001 From: Rahadian Wibisono Date: Wed, 9 Dec 2020 19:43:27 +0700 Subject: [PATCH] Change Menu, fix animation and improve smoothmoving --- CHANGELOG.md | 6 ++++++ css/main.css | 14 ++++---------- scripts/three/modules/WebSocketHandler.js | 5 ++--- scripts/three/three.module.js | 11 +++++++++++ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36bad0d..ee834a8 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Rabbit Sky Client Changelog +## Version 0.1.6.4 +- This version is compatible with Server v0.1.6. +- Change Menu Background Color +- Fix rabbit animation always update, causing some performance issue. +- Improve smooth animation so it is not updating non-visible rabbit on camera. + ## Version 0.1.6.3 - This version is compatible with Server v0.1.6. - Fix escape button showing options in menu. diff --git a/css/main.css b/css/main.css index 06ccb6b..92d5154 100755 --- a/css/main.css +++ b/css/main.css @@ -123,13 +123,6 @@ div, label, a { right: 0; left: 0; - /* - background-image: url("../images/menu.jpg"); - background-position: center center; - background-repeat: no-repeat; - background-size: cover; - */ - background-color: rgba(72, 87, 181, 0.5); display: flex; @@ -144,7 +137,8 @@ div, label, a { max-width: 500px; padding: 40px 20px; box-sizing: border-box; - background-color: rgba(255,255,255,0.6); + background-color: rgba(0,0,0,0.4); + box-shadow: 2px 2px #FFFFFF; z-index: 3; } @@ -177,14 +171,14 @@ div, label, a { } #main-menu #main-menu-logo #main-menu-now-playing-info { - color: #000000; + color: #ffffff; font-size: 7px; margin-bottom: 3px; text-align: center; } #main-menu #main-menu-logo #main-menu-now-playing { - color: #333333; + color: #c9c9c9; text-align: center; } diff --git a/scripts/three/modules/WebSocketHandler.js b/scripts/three/modules/WebSocketHandler.js index 8015505..2b15c40 100755 --- a/scripts/three/modules/WebSocketHandler.js +++ b/scripts/three/modules/WebSocketHandler.js @@ -740,13 +740,13 @@ var WebSocketHandler = function(rabbit, floor) { this.rabbitsAnimationHelper[id].toLookZ = this.rabbitsUpdateTo[id].lookZ; // update + this.rabbitsUpdateTo[id].changed = false; this.rabbitsAnimationHelper[id].changed = true; } if(this.rabbitsAnimationHelper[id].changed) { - if(percentProgress < 1) { - + if(percentProgress < 1 && (animateFirstFrame || this.rabbits[id].object.visibleCamera)) { // Move var diffPercentX = (this.rabbitsAnimationHelper[id].toX - this.rabbitsAnimationHelper[id].x) * percentProgress; var diffPercentY = (this.rabbitsAnimationHelper[id].toY - this.rabbitsAnimationHelper[id].y) * percentProgress; @@ -768,7 +768,6 @@ var WebSocketHandler = function(rabbit, floor) { this.rabbits[id].lookAt(lookX, lookY, lookZ); } else { - this.rabbits[id].move(this.rabbitsAnimationHelper[id].toX, this.rabbitsAnimationHelper[id].toY, this.rabbitsAnimationHelper[id].toZ); this.rabbits[id].lookAt(this.rabbitsAnimationHelper[id].toLookX, this.rabbitsAnimationHelper[id].toLookY, this.rabbitsAnimationHelper[id].toLookZ); diff --git a/scripts/three/three.module.js b/scripts/three/three.module.js index 94a64b1..7d6e36d 100755 --- a/scripts/three/three.module.js +++ b/scripts/three/three.module.js @@ -6415,6 +6415,9 @@ function Object3D() { this.userData = {}; + // Extra Rabbit Sky + this.visibleCamera = false; + } Object3D.DefaultUp = new Vector3( 0, 1, 0 ); @@ -24202,6 +24205,9 @@ function WebGLRenderer( parameters ) { if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { + // Extra Rabbit Sky + object.visibleCamera = true; + if ( sortObjects ) { _vector3.setFromMatrixPosition( object.matrixWorld ) @@ -24235,6 +24241,11 @@ function WebGLRenderer( parameters ) { } + } else { + + // Extra Rabbit Sky + object.visibleCamera = false; + } }