transform method

  1. @override
void transform(
  1. Vector2 position,
  2. Vector2 uv,
  3. Color light,
  4. Color dark,
)
override

Implementation

@override
void transform(Vector2 position, Vector2 uv, Color light, Color dark) {
  final double radAngle = angle * MathUtils.degreesToRadians;
  final double x = position.x - worldX;
  final double y = position.y - worldY;
  final double dist = math.sqrt(x * x + y * y);
  if (dist < radius) {
    final double theta =
        interpolation.apply(0.0, radAngle, (radius - dist) / radius);
    final double cos = math.cos(theta);
    final double sin = math.sin(theta);
    position
      ..x = cos * x - sin * y + worldX
      ..y = sin * x + cos * y + worldY;
  }
}