shadowed
▸ Const
computeShadows(bounds
, walls
, light
): Vec2[][]
Computes casted shadows by a light for a given set of walls within specified bounds.
example
computeShadows(
{
topLeft: { x: 0, y: 0 },
bottomRight: { x: 640, y: 360 },
},
[{
a: { x: 20, y: 80 },
b: { x: 80, y: 30}
}],
{ x: 100, y: 200 },
);
Name | Type | Description |
---|---|---|
bounds |
Bounds | A rectangle where the shadows will be contained. |
walls |
Segment2[] | Segments that will cast shadows. |
light |
Vec2 | Position of the light. |
Vec2[][]