getView method

VectorList<Vector> getView (Float32List buffer)

Implementation

VectorList<Vector> getView(Float32List buffer) {
  final int viewOffset = offset ~/ buffer.elementSizeInBytes;
  final int viewStride = stride ~/ buffer.elementSizeInBytes;
  switch (size) {
    case 2:
      return new Vector2List.view(buffer, viewOffset, viewStride);
    case 3:
      return new Vector3List.view(buffer, viewOffset, viewStride);
    case 4:
      return new Vector4List.view(buffer, viewOffset, viewStride);
    default:
      throw new StateError('size of $size is not supported');
  }
}