Skip to content

Commit

Permalink
Change Menu, fix animation and improve smoothmoving
Browse files Browse the repository at this point in the history
  • Loading branch information
w1bi committed Dec 9, 2020
1 parent 24a3d3e commit 53b894f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
14 changes: 4 additions & 10 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 2 additions & 3 deletions scripts/three/modules/WebSocketHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down
11 changes: 11 additions & 0 deletions scripts/three/three.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -6415,6 +6415,9 @@ function Object3D() {

this.userData = {};

// Extra Rabbit Sky
this.visibleCamera = false;

}

Object3D.DefaultUp = new Vector3( 0, 1, 0 );
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -24235,6 +24241,11 @@ function WebGLRenderer( parameters ) {

}

} else {

// Extra Rabbit Sky
object.visibleCamera = false;

}

}
Expand Down

0 comments on commit 53b894f

Please sign in to comment.