Live data from Hacker News

Collision Detection (2015)

jeffreythompson.org

11–20 of 36 posts

Re: Collision Detection (2015)

#12
post #5
post #2

Very 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.

> 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)

#13
post #5

Earlier 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.

Art of Electronics is one, would have to think about the third.

Re: Collision Detection (2015)

#14
post #9

It'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.

It looks it intends not to touch broad phase things.

Re: Collision Detection (2015)

#15
post #6

I've always defaulted to squaring the radii for circle collision to avoid the sqrt. Is it a premature optimization these days?

My 8-bit games just used rectangles; for circles I just overlapped two inside the geometry in a fat "+" shape. This was on a platform with pixel-accurate collision detection in hardware, and I always thought that the sloppy geometry-based detection was more fun for players.

N-squared for single-digit N worked just fine, too.

Re: Collision Detection (2015)

#17
In my experience, collision detection is the easy piece (partly due to the prevalence of resources like this one); collision resolution is where you start having to make compromises (and there aren’t always clean solutions).

Re: Collision Detection (2015)

#18
post #2

Very 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.

I learned a tremendous amount of information from that book. It's _the_ book to get if you're interested in collision and related spatial data structures.

Re: Collision Detection (2015)

#19
post #6

I've always defaulted to squaring the radii for circle collision to avoid the sqrt. Is it a premature optimization these days?

Historial note: To avoid sqrt, the Atari baseball cartridge went the 1897 Indiana legislature one better, using octagons as circles.

π ~= 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
I have brief look at this book and it looks nice and easy to read, however I noted the author works with floating point numbers and in some places, you can see snippets like this:

// 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.

Post reply on HN