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