generateVertexPositions method

  1. @override
void generateVertexPositions(
  1. Vector3List positions,
  2. Uint16List indices
)
override

Implementation

@override
void generateVertexPositions(Vector3List positions, Uint16List indices) {
  final v = Vector3.zero();
  positions[0] = v;
  var index = 1;
  for (var i = 0; i <= _segments; i++) {
    final percent = i / _segments;
    v
      ..x = _radius * math.cos(_thetaStart + percent * _thetaLength)
      ..z = _radius * math.sin(_thetaStart + percent * _thetaLength);
    positions[index] = v;
    index++;
  }
  assert(index == vertexCount);
}