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();
  int index = 0;
  for (int i = 0; i <= _segments; i++) {
    final double percent = i / _segments;
    v
      ..x = _innerRadius * math.cos(_thetaStart + percent * _thetaLength)
      ..z = _innerRadius * math.sin(_thetaStart + percent * _thetaLength);
    positions[index] = v;
    index++;
    v
      ..x = _outerRadius * math.cos(_thetaStart + percent * _thetaLength)
      ..z = _outerRadius * math.sin(_thetaStart + percent * _thetaLength);
    positions[index] = v;
    index++;
  }
  assert(index == vertexCount);
}