Update: CC - Demo New - Entity Loaded (tuby5lj4di.js) 85 bytes modified

beta.r3js.org
-=yb4f310 2018-02-16 12:55:34 +01:00
parent 0b6f2eabca
commit 722c1a9ae0
1 changed files with 21 additions and 15 deletions

View File

@ -221,28 +221,34 @@ GameLib.CustomCode.prototype.updateAttributeArrays = function(alpha) {
var i, offset, scale;
var offsets = [];
var scales = [];
var v = new THREE.Vector3();
for (i = 0; i < this.updateInformation.length; i++) {
offset = this.updateInformation[i].offset;
scale = this.updateInformation[i].scale;
this.offsetAttribute.setXYZ(
i*3,
offset.current.lerp(
offset.target,
alpha
)
v = offset.current.lerp(
offset.target,
alpha
);
this.scaleAttribute.setXYZ(
i*3,
scale.current.lerp(
scale.target,
alpha
)
);
offsets.push(v.x, v.y, v.z);
v = scale.current.lerp(
scale.target,
alpha
);
scales.push(v.x, v.y, v.z);
}
this.offsetAttribute.setArray(new Float32Array(offsets));
this.scaleAttribute.setArray(new Float32Array(scales));
this.offsetAttribute.needsUpdate = true;
this.scaleAttribute.needsUpdate = true;