Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge earcut triangles #6

Open
amytimed opened this issue May 9, 2023 · 3 comments
Open

Merge earcut triangles #6

amytimed opened this issue May 9, 2023 · 3 comments

Comments

@amytimed
Copy link
Member

amytimed commented May 9, 2023

Box2D supports more points than that, having loads of small triangles leads to intersection and lag

@EJTH
Copy link

EJTH commented May 12, 2023

I will look into optimizing earcut integration.

@EJTH EJTH self-assigned this May 12, 2023
@amytimed
Copy link
Member Author

great!
I'm thinking just combining triangles that share two points would be a good start

if I recall correctly, box2d can take up to 8 points on a polygon. each piece should ideally be 8 points in that case.

the less pieces, the better, for both performance and preventing weird collision

@amytimed
Copy link
Member Author

when polygons collide, it's currently laggy because of all the small triangles.

when box2d shapes collide (without continuous collision detection) they are, for a few frames, overlapping slightly. with all the small fixtures from triangulation, some triangles get stuck together, which not only leads to weird collision, but also frame drops

@amytimed amytimed moved this to Todo in Simulo Alpha May 13, 2023
@amytimed amytimed added this to the Alpha First Version milestone May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants