11.07.2015 Views

Collision Detection

Collision Detection

Collision Detection

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Spatial Hashing Motivation: large grids are usually very sparse –we need to store data only for non-empty cells –but we need fast O(1) access based on (x,y,z) Given point p=(x,y,z) laying within cell c=(i,j,k) wedefine spatial hashing function as hash(i,j,k) = (ip 1xor jp 2xor jp 3) mod n Where p 1, p 2, p 3are large prime numbers and n isthe size of hash table Hash collision are solved with buckets

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!