updateForCamera method

void updateForCamera(
  1. Camera camera,
  2. Size viewportSize
)

Rebuilds the camera-facing strip for camera and viewportSize.

Call once per frame before rendering. Reuses the GPU buffers.

Implementation

void updateForCamera(Camera camera, ui.Size viewportSize) {
  final expanded = expandPolyline(
    _points,
    widths: _widths,
    widthMode: _widthMode,
    diskPoints: _diskPoints,
    drawStart: drawStart,
    drawEnd: drawEnd,
    viewProjection: camera.getViewTransform(viewportSize),
    cameraPosition: camera.position,
    viewportSize: viewportSize,
  );
  updatePositions(expanded.positions);
  updateNormals(expanded.normals);
}