rename some fields in MorphAnimationData

This commit is contained in:
Nick Fisher
2023-08-20 23:26:14 +08:00
parent 042439a72b
commit a52b6f9610

View File

@@ -8,24 +8,24 @@ import 'dart:typed_data';
class MorphAnimationData {
final String meshName;
final List<String> morphNames;
final List<int> morphIndices;
final List<String> animatedMorphNames;
final List<int> animatedMorphIndices;
final List<double> data;
MorphAnimationData(this.meshName, this.data, this.morphNames,
this.morphIndices, this.frameLengthInMs) {
assert(data.length == morphNames.length * numFrames);
MorphAnimationData(this.meshName, this.data, this.animatedMorphNames,
this.animatedMorphIndices, this.frameLengthInMs) {
assert(data.length == animatedMorphNames.length * numFrames);
}
int get numMorphTargets => morphNames.length;
int get numMorphTargets => animatedMorphNames.length;
int get numFrames => data.length ~/ numMorphTargets;
final double frameLengthInMs;
Iterable<double> getData(String morphName) sync* {
int index = morphNames.indexOf(morphName);
int index = animatedMorphNames.indexOf(morphName);
for (int i = 0; i < numFrames; i++) {
yield data[(i * numMorphTargets) + index];
}