refactor: opt
This commit is contained in:
parent
5f15e46234
commit
4479364b26
|
@ -115,10 +115,11 @@ export default class ModulatedProperty extends decorate(Class) {
|
||||||
location -= frequency;
|
location -= frequency;
|
||||||
}
|
}
|
||||||
this.location = location;
|
this.location = location;
|
||||||
const value = this.modulators.reduce(
|
let acc = 0;
|
||||||
(value, m) => value + m(location / frequency, this),
|
for (let i = 0; i < this.modulators.length; i++) {
|
||||||
0,
|
acc += this.modulators[i](location / frequency, this);
|
||||||
) / this.modulators.length;
|
}
|
||||||
|
const value = acc / this.modulators.length;
|
||||||
this.object[this.key] = this.min + this.factor * value * this.magnitude;
|
this.object[this.key] = this.min + this.factor * value * this.magnitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user