setIndex method

void setIndex(
  1. dynamic index
)

Implementation

void setIndex(index) {
  // if ( Array.isArray( index ) ) {

  // 	this.index = new ( arrayMax( index ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 );

  // } else {

  // this.index = index;

  // }

  if (index is List) {
    final list = index.map<int>((e) => e.toInt()).toList();
    final max = arrayMax(list);
    if (max != null && max > 65535) {
      this.index = Uint32BufferAttribute(Uint32Array.from(list), 1, false);
    } else {
      this.index = Uint16BufferAttribute(Uint16Array.from(list), 1, false);
    }
  } else {
    this.index = index;
  }
}