feat: add reusable Polygon abstraction - #454
Conversation
427e299 to
11b6d11
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11b6d117f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c17c1f11e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var previous = vertices.get(vertices.size() - 1) | ||
| for i = 0 to vertices.size() - 1 | ||
| let current = vertices.get(i) | ||
| let border = addLightning("DBRC", false, previous, current) |
There was a problem hiding this comment.
Replace the invalid polygon-border lightning rawcode
With stock Warcraft lightning data, DBRC is not a valid built-in lightning rawcode; the imported Lightning package exposes the drain type as LIGHTNING_DRAIN (DRAB). Consequently, calling debugRender creates a null lightning handle and the following setColor call aborts the thread, so both timed and untimed rendering fail in-game. Use one of the package's defined lightning constants instead of this raw string.
AGENTS.md reference: AGENTS.md:L69-L69
Useful? React with 👍 / 👎.
Summary
Polygonclass with builder and vararg constructionrectafter sealingcontains/containsStrictqueries for convex, concave, degenerate, reversed, and self-intersecting pathsvec2.isInPolygon(vararg vec2)andvec3.isInPolygon2d(vararg vec3)APIsOwnership
Polygonowns its cached bounds. Untimed debug rendering returns a caller-ownedArrayList<lightning>; timed rendering owns and cleans its handles.Verification
grill install— passedgrill typecheck --quiet— passedgrill test PolygonTests— 15/15 passedgrill test vectorTests— 1/1 passedgit diff --check upstream/master...HEAD— passedgrill test --quietstill reports five SQLite interpreter-native failures. The exact same failures reproduce onupstream/master, so they are unrelated to this PR.Warcraft-native lightning creation, coloring, and timed destruction are compile-checked but not Warcraft-runtime verified because Grill cannot execute those natives.