From 1bb97179ab5b6631814d1d41cc3b37e105dd044b Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 16 Feb 2018 12:34:49 +0100 Subject: [PATCH] Update: CC - Demo New - Entity Loaded (tuby5lj4di.js) 131 bytes modified --- tuby5lj4di.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tuby5lj4di.js b/tuby5lj4di.js index a69a917..b994881 100644 --- a/tuby5lj4di.js +++ b/tuby5lj4di.js @@ -143,11 +143,9 @@ GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) { }.bind(this); -GameLib.CustomCode.prototype.startAnimation = function(attributeData) { - this.generateAnimationVectors(attributeData); - this.beforeRender.startAnimation = true; -}.bind(this); - +/** + * Builds update information holding our current position and scale, and our target position and scale + */ GameLib.CustomCode.prototype.generateAnimationVectors = function(attributeData) { if (!attributeData) { @@ -192,6 +190,9 @@ GameLib.CustomCode.prototype.generateAnimationVectors = function(attributeData) } }.bind(this); +/** + * Performs the actual update to our instanced geometry + */ GameLib.CustomCode.prototype.updateAttributeArrays = function(alpha) { console.log('animation : ' + alpha); }.bind(this); @@ -209,7 +210,13 @@ GameLib.CustomCode.prototype.loadNext = function() { var attributeData = this.generateAttributeData(this.currentIndex, 128, 128); - this.startAnimation(attributeData); + this.generateAnimationVectors(attributeData); + + /** + * Notify our render component that we are ready to start animating + */ + this.beforeRender.startAnimation = true; + }.bind(this); this.buildInstancedGeometry(0);