GeoMan - Geometry library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
dusoft
Party member
Posts: 654
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: GeoMan - Geometry library

Post by dusoft »

Bigfoot71 wrote: Sun Nov 20, 2022 9:58 pm
dusoft wrote: Sun Nov 20, 2022 7:07 pm I am curious about performance intersects detection for multiple polygons at once, e.g. one player body and tens/hundreds of enemies.
Here is a small demo that I just made very quickly. The player himself is represented by a polygon and there is an adjustable number of enemies (also represented by polygons).

I use the isPolyInPoly function for collisions, which can be quite greedy, and no optimization has been done as mentioned by Ivan, at each frame all enemies will test their collision with the player.

I tried up to a hundred and something enemies and was running at 60 FPS on an Intel Pentium J2900.

I would like to specify that the more the number of vertices will be, the more the time required will be high too, demo only contains hexagons, therefore 6 vertices per shape.

Edit: Here is a video where I went up to more than 1000 polygons and I kept the 60 FPS rather well, I myself am pleasantly surprised ! ^^ https://streamable.com/6mm3ud
I have tested it and it seems to be well performing, good job!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests