Sleepy-Fish / BogieJS

Simple collision extensions for PIXI.js
MIT License
2 stars 0 forks source link

Polygon Shape Class #2

Open JRileyH opened 4 years ago

JRileyH commented 4 years ago

A Spacial class extension that accepts an array of points for its vertices and can be any arbitrary shape.

Creation should determine if the polygon is convex or concave and flag itself respectively for use with collision calculations.

Creation should determine if polygon edges intersect and throw an error if there is any twisting or internal overlap of edges.

Initial point array should be able to complete itself or adequately ignore the last point of its the same as the first.

Points that are extremely close together (by some configuration variable. Should be averaged together to save on collision calculations.

A point array that exceeds the length of some limit (by some configuration variable) should by reduced to that number by merging and averaging closest points (unless specified otherwise) to save on collision calculations.