Update: CC - SnailRunner - Before Render (94xi7aitax.js) 147 bytes modified
parent
a33b30d7fd
commit
ab764f97a2
|
@ -48,17 +48,26 @@ this.sections.map(
|
|||
}
|
||||
);
|
||||
|
||||
if (this.camera.position.z < this.snail.position.z) {
|
||||
var modified = false;
|
||||
|
||||
if ((this.camera.position.z - this.snail.position.z) > 0.1) {
|
||||
this.camera.position.z += data.delta;
|
||||
} else {
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if ((this.snail.position.z - this.camera.position.z) > 0.1) {
|
||||
this.camera.position.z -= data.delta;
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (modified) {
|
||||
this.camera.updateInstance('position');
|
||||
|
||||
this.camera.lookAt.x = this.snail.position.x;
|
||||
this.camera.lookAt.y = this.snail.position.y;
|
||||
this.camera.lookAt.z = this.snail.position.z;
|
||||
this.camera.updateInstance('lookAt');
|
||||
}
|
||||
this.camera.updateInstance('position');
|
||||
|
||||
this.camera.lookAt.x = this.snail.position.x;
|
||||
this.camera.lookAt.y = this.snail.position.y;
|
||||
this.camera.lookAt.z = this.snail.position.z;
|
||||
this.camera.updateInstance('lookAt');
|
||||
|
||||
this.time += data.delta;
|
||||
|
||||
|
|
Loading…
Reference in New Issue