clone method

BufferAttribute<NativeArray<num>> clone()

Implementation

BufferAttribute clone() {
  // if (type == "BufferAttribute") {
  //   return BufferAttribute(array, itemSize, false).copy(this);
  // } else
  if (type == "Float32BufferAttribute") {
    final typed = array as Float32Array;
    return Float32BufferAttribute(Float32Array(typed.length), itemSize, false).copy(this);
  } else if (type == "Uint8BufferAttribute") {
    final typed = array as Uint8Array;
    return Uint8BufferAttribute(Uint8Array(typed.length), itemSize, false).copy(this);
  } else if (type == "Uint16BufferAttribute") {
    final typed = array as Uint16Array;
    return Uint16BufferAttribute(Uint16Array(typed.length), itemSize, false).copy(this);
  } else {
    throw ("BufferAttribute type: $type clone need support ....  ");
  }
}