From 1f30e7c8e6747097dd9baa96d0be684e0fd01dba Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 9 Mar 2018 17:18:10 +0100 Subject: [PATCH] Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 200 bytes modified --- 78gnds8jrj.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/78gnds8jrj.js b/78gnds8jrj.js index 153b647..80a132d 100644 --- a/78gnds8jrj.js +++ b/78gnds8jrj.js @@ -34,13 +34,12 @@ this.clouds = []; this.maxSpeed = 50; this.speedPercentage = 0; -this.initialCameraPosition = new THREE.Vector3(0, 1.1, 0); -this.maximumCameraPosition = new THREE.Vector3(0, 2.6, 0); -this.currentCameraPosition = new THREE.Vector3(0, 1.1, 0); - -this.initialCameraFOV = new THREE.Vector3(0, 40, 0); -this.maximumCameraFOV = new THREE.Vector3(0, 90, 0); -this.currentCameraFOV = new THREE.Vector3(0, 40, 0); +/** + * Camera settings y = height, z = FOV + */ +this.initialCameraSettings = new THREE.Vector3(0, 1.1, 40); +this.maximumCameraSettings = new THREE.Vector3(0, 2.6, 90); +this.currentCameraSettings = new THREE.Vector3(0, 1.1, 40); /** * Camera, Raycaster, Mouse @@ -179,13 +178,16 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) { this.speedPercentage = this.speed / this.maxSpeed; - this.currentCameraPosition.lerpVectors(this.initialCameraPosition, this.maximumCameraPosition, this.speedPercentage); - this.currentCameraFOV.lerpVectors(this.initialCameraFOV, this.maximumCameraFOV, this.speedPercentage); + this.currentCameraSettings.lerpVectors( + this.initialCameraSettings, + this.maximumCameraSettings, + this.speedPercentage + ); - this.camera.position.y = this.currentCameraPosition.y; + this.camera.position.y = this.currentCameraSettings.y; this.camera.updateInstance('position'); - this.camera.fov = this.currentCameraFOV.y; + this.camera.fov = this.currentCameraSettings.z; this.camera.updateInstance('fov');