rename some fields in MorphAnimationData
This commit is contained in:
@@ -8,24 +8,24 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
class MorphAnimationData {
|
class MorphAnimationData {
|
||||||
final String meshName;
|
final String meshName;
|
||||||
final List<String> morphNames;
|
final List<String> animatedMorphNames;
|
||||||
final List<int> morphIndices;
|
final List<int> animatedMorphIndices;
|
||||||
|
|
||||||
final List<double> data;
|
final List<double> data;
|
||||||
|
|
||||||
MorphAnimationData(this.meshName, this.data, this.morphNames,
|
MorphAnimationData(this.meshName, this.data, this.animatedMorphNames,
|
||||||
this.morphIndices, this.frameLengthInMs) {
|
this.animatedMorphIndices, this.frameLengthInMs) {
|
||||||
assert(data.length == morphNames.length * numFrames);
|
assert(data.length == animatedMorphNames.length * numFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
int get numMorphTargets => morphNames.length;
|
int get numMorphTargets => animatedMorphNames.length;
|
||||||
|
|
||||||
int get numFrames => data.length ~/ numMorphTargets;
|
int get numFrames => data.length ~/ numMorphTargets;
|
||||||
|
|
||||||
final double frameLengthInMs;
|
final double frameLengthInMs;
|
||||||
|
|
||||||
Iterable<double> getData(String morphName) sync* {
|
Iterable<double> getData(String morphName) sync* {
|
||||||
int index = morphNames.indexOf(morphName);
|
int index = animatedMorphNames.indexOf(morphName);
|
||||||
for (int i = 0; i < numFrames; i++) {
|
for (int i = 0; i < numFrames; i++) {
|
||||||
yield data[(i * numMorphTargets) + index];
|
yield data[(i * numMorphTargets) + index];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user