Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 200 bytes modified

beta.r3js.org
-=yb4f310 2018-03-09 17:18:10 +01:00
parent 269a3f0643
commit 1f30e7c8e6
1 changed files with 13 additions and 11 deletions

View File

@ -34,13 +34,12 @@ this.clouds = [];
this.maxSpeed = 50; this.maxSpeed = 50;
this.speedPercentage = 0; this.speedPercentage = 0;
this.initialCameraPosition = new THREE.Vector3(0, 1.1, 0); /**
this.maximumCameraPosition = new THREE.Vector3(0, 2.6, 0); * Camera settings y = height, z = FOV
this.currentCameraPosition = new THREE.Vector3(0, 1.1, 0); */
this.initialCameraSettings = new THREE.Vector3(0, 1.1, 40);
this.initialCameraFOV = new THREE.Vector3(0, 40, 0); this.maximumCameraSettings = new THREE.Vector3(0, 2.6, 90);
this.maximumCameraFOV = new THREE.Vector3(0, 90, 0); this.currentCameraSettings = new THREE.Vector3(0, 1.1, 40);
this.currentCameraFOV = new THREE.Vector3(0, 40, 0);
/** /**
* Camera, Raycaster, Mouse * Camera, Raycaster, Mouse
@ -179,13 +178,16 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) {
this.speedPercentage = this.speed / this.maxSpeed; this.speedPercentage = this.speed / this.maxSpeed;
this.currentCameraPosition.lerpVectors(this.initialCameraPosition, this.maximumCameraPosition, this.speedPercentage); this.currentCameraSettings.lerpVectors(
this.currentCameraFOV.lerpVectors(this.initialCameraFOV, this.maximumCameraFOV, this.speedPercentage); 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.updateInstance('position');
this.camera.fov = this.currentCameraFOV.y; this.camera.fov = this.currentCameraSettings.z;
this.camera.updateInstance('fov'); this.camera.updateInstance('fov');