Provide an interface for bulk-updating a Drawable

The renderer can now update any combination of a Drawable's position,
direction, scale, and effect values through a single function call. The
effect values will be adjusted according to per-effect conversion
functions to prepare the values for use inside the shader.
This commit is contained in:
Christopher Willis-Ford
2016-05-18 16:15:46 -07:00
parent db69b23a0e
commit 798981812d
3 changed files with 78 additions and 62 deletions

View File

@@ -23,9 +23,13 @@
var scale = 100;
function thinkStep() {
direction += 0.1;
renderer.setDrawablePosition(drawableID, posX, posY);
renderer.setDrawableDirection(drawableID, direction);
renderer.setDrawableScale(drawableID, scale);
var props = {};
//props.position = [posX, posY];
props.direction = direction;
//props.scale = 100;
renderer.updateDrawableProperties(drawableID, props);
}
drawStep();
setInterval(thinkStep, 1/60);