generateIndices method Null safety

  1. @override
void generateIndices(
  1. Uint16List indices
)
override

Implementation

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

    for (var 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;
    }
  }
}