denormalize function

void denormalize(
  1. Vector morph,
  2. BufferAttribute<NativeArray<num>> attribute
)

Implementation

void denormalize(Vector morph, BufferAttribute attribute) {
  double denominator = 1;
  NativeArray array = attribute is InterleavedBufferAttribute ? attribute.data!.array : attribute.array;

  if (array is Int8Array) {
    denominator = 127;
  }
  else if (array is Int16Array) {
    denominator = 32767;
  }
  else if (array is Int32Array) {
    denominator = 2147483647;
  }
  else {
    console.error('three.WebGLMorphtargets: Unsupported morph attribute data type: $array');
  }

  morph.divideScalar(denominator);
}