Prozi / detect-collisions

Detect collisions between different shapes such as Points, Lines, Boxes, Polygons (including concave), Ellipses, and Circles. Features include RayCasting and support for offsets, rotation, scaling, bounding box padding, with options for static and trigger bodies (non-colliding).
https://prozi.github.io/detect-collisions/
MIT License
202 stars 21 forks source link

Add scale to Polygon and Circle #35

Closed Codezilluh closed 2 years ago

Codezilluh commented 2 years ago

this would close #32

adds body.setScale(x, y) method and body.scale = x shorthand.

Prozi commented 2 years ago

also if you'd find time please add tests that change scale for rotated objects

for example a rotated box. then we scale it, did it loos the angle or not? a simple test like that would do fine

Codezilluh commented 2 years ago

change scale for rotated objects

Good point, didn't think of that situation. Probably doesn't work with rotation, but fixing that seems easy. I will test.

Prozi commented 2 years ago

beautiful!

the CI has outdated config (which I fixed on master - missing rebuild dist step) which shows failed tests but I've checked out your branch and ran yarn; yarn build; yarn test

which shows all green :+1: I will shortly merge this to master, bump version, run precommit to regen docs and then publish

good work! thank you for another contribution