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);