Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 70 bytes modified
parent
8a9272ddcf
commit
781a71671e
|
@ -36,6 +36,7 @@ this.speedPercentage = 0;
|
||||||
|
|
||||||
this.initialCameraPosition = new THREE.Vector3(0, 1.1, 0);
|
this.initialCameraPosition = new THREE.Vector3(0, 1.1, 0);
|
||||||
this.maximumCameraPosition = new THREE.Vector3(0, 2.6, 0);
|
this.maximumCameraPosition = new THREE.Vector3(0, 2.6, 0);
|
||||||
|
this.currentCameraPosition = new THREE.Vector3(0, 1.1, 0);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -175,11 +176,9 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) {
|
||||||
|
|
||||||
this.speedPercentage = this.speed / this.maxSpeed;
|
this.speedPercentage = this.speed / this.maxSpeed;
|
||||||
|
|
||||||
var pos = this.initialCameraPosition.lerp(this.maximumCameraPosition, this.speedPercentage);
|
this.currentCameraPosition.lerpVectors(this.initialCameraPosition, this.maximumCameraPosition, this.speedPercentage);
|
||||||
|
|
||||||
console.log(this.speedPercentage);
|
this.camera.position.y = this.currentCameraPosition.y;
|
||||||
|
|
||||||
this.camera.position.y = pos.y;
|
|
||||||
this.camera.updateInstance('position');
|
this.camera.updateInstance('position');
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
Loading…
Reference in New Issue