feat: Add polygon debugging
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user