generateIndices method

  1. @override
void generateIndices (Uint16List indices)
override

Implementation

@override
void generateIndices(Uint16List indices) {
  int i = 0;
  for (int y = 0; y < _latSegments; ++y) {
    final int base1 = (_lonSegments + 1) * y;
    final int base2 = (_lonSegments + 1) * (y + 1);

    for (int x = 0; x < _lonSegments; ++x) {
      indices[i++] = base1 + x;
      indices[i++] = base1 + x + 1;
      indices[i++] = base2 + x;

      indices[i++] = base1 + x + 1;
      indices[i++] = base2 + x + 1;
      indices[i++] = base2 + x;
    }
  }
}