-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Objective - As discussed on [Discord](https://discord.com/channels/691052431525675048/1203087353850364004/1285300659746246849), implement a `ConvexPolygon` 2D math primitive and associated mesh builder. - The original goal was to have a mesh builder for the simplest (i.e. convex) polygons. ## Solution - The `ConvexPolygon` is created from its vertices. - The convexity of the polygon is checked when created via `new()` by verifying that the winding order of all the triangles formed with adjacent vertices is the same. - The `ConvexPolygonMeshBuilder` uses an anchor vertex and goes through every adjacent pair of vertices in the polygon to form triangles that fill up the polygon. ## Testing - Tested locally with my own simple `ConvexPolygonMeshBuilder` usage.
- Loading branch information
Showing
3 changed files
with
114 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters