denormalize function
void
denormalize(
- Vector morph,
- BufferAttribute<TypedDataList> attribute
)
Implementation
void denormalize(Vector morph, BufferAttribute attribute) {
double denominator = 1;
TypedDataList array = attribute is InterleavedBufferAttribute ? attribute.data!.array : attribute.array;
if (array is Int8List) {
denominator = 127;
}
else if (array is Int16List) {
denominator = 32767;
}
else if (array is Int32List) {
denominator = 2147483647;
}
else {
console.error('three.WebGLMorphtargets: Unsupported morph attribute data type: $array');
}
morph.divideScalar(denominator);
}