I've always defaulted to squaring the radii for circle collision to avoid the sqrt. Is it a premature optimization these days?
Collision Detection (2015)
11–20 of 36 posts
Re: Collision Detection (2015)
#12Very nice! A very good resource on collision detection is the book by Christer Ericson (2005). However it is more geared towards c++ realtime games. https://realtimecollisiondetection.net/ I appreciate this nice site too.
That book is in my top 3 technical books of all time. It's basically data structures for 2D/3D space. It's also the only algorithms book I've found that actually has a whole section on how to write cache aware algorithms, pure gold.
If you don't mind me asking, what are the other two top books?
> a whole section on how to write cache aware algorithms
"Efficient Memory Programming" by David Loshin is worth a look.
Re: Collision Detection (2015)
#13Earlier quoted context omitted.
That book is in my top 3 technical books of all time. It's basically data structures for 2D/3D space. It's also the only algorithms book I've found that actually has a whole section on how to write cache aware algorithms, pure gold.
> That book is in my top 3 technical books of all time. If you don't mind me asking, what are the other two top books? > a whole section on how to write cache aware algorithms "Efficient Memory Programming" by David Loshin is worth a look.
Re: Collision Detection (2015)
#14It's a very basic intro. Polygon/polygon is brute force, O(N^2). There's no coarse filtering so that only nearby objects are checked. There's nothing that points out that concave objects are much harder to check efficiently than convex ones. Plus it's 2D only. An intro is nice, but this is like writing about sorting and only showing bubble sort.
Re: Collision Detection (2015)
#15I've always defaulted to squaring the radii for circle collision to avoid the sqrt. Is it a premature optimization these days?
N-squared for single-digit N worked just fine, too.
Re: Collision Detection (2015)
#16Re: Collision Detection (2015)
#17Re: Collision Detection (2015)
#18Very nice! A very good resource on collision detection is the book by Christer Ericson (2005). However it is more geared towards c++ realtime games. https://realtimecollisiondetection.net/ I appreciate this nice site too.
Re: Collision Detection (2015)
#19I've always defaulted to squaring the radii for circle collision to avoid the sqrt. Is it a premature optimization these days?
π ~= 3,314?
Unte im finyish du kaxa okwa bik, 4 600 mm bi wit dek xante im. Na desh kuwang, unte im 2 300 mm gova bik, unte 14 000 mm fo imim du gang im. - 1 Da Bosmang Da Bik Imalowda 7:23
Re: Collision Detection (2015)
#20// are the two points in the same location? if (x1 == x2 && y1 == y2) { return true; }
You should never compare two floating-point numbers for equality. Use interval and to determine if two numbers are close.