Update: CC - Demo New - Before Render (wlw063ovw9.js) 424 bytes modified

beta.r3js.org
-=yb4f310 2018-02-21 09:54:42 +01:00
parent 896cf4363d
commit 11a726c7df
1 changed files with 19 additions and 0 deletions

View File

@ -13,6 +13,12 @@ if (!this.initialized) {
this.camera = this.entityLoaded.camera;
this.mouseMove = this.entityLoaded.mouseMove;
this.lookAtTarget = this.entityLoaded.lookAtTarget;
this.meshImageGrid = this.entityLoaded.meshImageGrid;
this.update = [];
this.time = 0;
@ -22,6 +28,19 @@ if (!this.initialized) {
this.time += 0.1 * data.delta;
this.lookAtTarget = this.entityLoaded.lookAtTarget;
if (this.lookAtTarget) {
var current = this.meshImageGrid.lookAt.instance;
var newLookAt = current.lerp(this.lookAtTarget, 0.1 * data.delta);
this.meshImageGrid.instance.lookAt(newLookAt);
}
if (this.startAnimation) {
this.time = 0;
this.animate = true;