generateVertexPositions method

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

Implementation

@override
void generateVertexPositions(Vector3List positions, Uint16List indices) {
  final Vector3 v = new Vector3.zero();
  positions[0] = v;
  int index = 1;
  for (int i = 0; i <= _segments; i++) {
    final double 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);
}