Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

Very fast 2D collision

$
0
0

Hello, I would like to know if there is a really very fast technique to detect collisions for a "big" number of sprites. Currently, I'm using the grid method, but it is not accurate.

For example, to get the sprite position on the grid, I use binary offsets to save CPU load. The problem is that to check if the sprite is on several boxes of the grid, it requires to do 4 operations by adding the width and the height of the hitbox, which kneels the CPU.

I work on a very weak system compared to current computers …


Viewing all articles
Browse latest Browse all 16874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>