feat: Add polygon debugging

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2026-01-05 12:59:02 +00:00
parent 9616e63e23
commit 071043adae
2 changed files with 58 additions and 1 deletions
+17 -1
View File
@@ -21,9 +21,11 @@ declare global {
}
}
export type Polygon = GlobalPoint[];
export type DebugElement = {
color: string;
data: LineSegment<GlobalPoint> | Curve<GlobalPoint>;
data: LineSegment<GlobalPoint> | Curve<GlobalPoint> | Polygon;
permanent: boolean;
};
@@ -129,6 +131,20 @@ export const debugDrawBounds = (
);
};
export const debugDrawPolygon = (
points: GlobalPoint[],
opts?: {
color?: string;
permanent?: boolean;
},
) => {
addToCurrentFrame({
color: opts?.color ?? "blue",
data: points,
permanent: !!opts?.permanent,
});
};
export const debugDrawPoints = (
{
x,