setPositions method

dynamic setPositions(
  1. dynamic array
)

Implementation

setPositions(array) {
  var lineSegments;

  if (array is Float32Array) {
    lineSegments = array;
  } else if (array is List) {
    lineSegments = Float32Array.from(List<double>.from(array));
  }

  var instanceBuffer = InstancedInterleavedBuffer(lineSegments, 6, 1); // xyz, xyz

  setAttribute('instanceStart', InterleavedBufferAttribute(instanceBuffer, 3, 0, false)); // xyz
  setAttribute('instanceEnd', InterleavedBufferAttribute(instanceBuffer, 3, 3, false)); // xyz

  //

  computeBoundingBox();
  computeBoundingSphere();

  return this;
}