transform method
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;
}
}