lighting/lighting_occluder library

Classes

LightingOccluder
A polygon that blocks light, in world coordinates.

Mixins

WithLightingOcclusion
Mixin for components that should block light where they are.

Functions

computeVisibilityPolygon({required Vector2 center, required double radius, required List<LightingOccluder> occluders, int rays = 64}) → List<Vector2>
Computes the region visible from center, limited by radius and clipped by occluders.
mergeOccluderTileGrid({required List<List<bool>> cells, required double tileWidth, required double tileHeight, double offsetX = 0, double offsetY = 0}) → List<Rect>
Merges a grid of blocked cells into as few rectangles as possible.
pointInPolygon(Vector2 point, List<Vector2> polygon) → bool
Whether point is inside the polygon defined by polygon.