Skip to main content
GameDev.net gamedev.net
🔒 Locked

A question about Collision data structure

Started by bargasteh Jan 31, 2006 at 9:18 AM 2 replies 700+ views
Original Post
bargasteh
bargasteh
Hello I would like to find out that which one and why one of these is better than another: Scenario: Imagine I have two or more objects and each object has lots of triangles, these objects could be deformable or solid (static). I want to do collision detection between these objects but I am not sure which one is the best way for real time animation (I need to implement the collision in 2 days). 1- divide the space into boxes and then do the collision only between those triangles that are in that space area (Box). if I do this then I have to reallocate triangles to each box. 2- use bounding box from beginning of animation. meaning I allocate set of triangles (neighboring ones) to each bounding box or sphere for each object and then check those bounding volumes and if they collide, check the collision between triangle and triangle. Is there any more ways ? it needs to be fast and not very difficult (rocket science). Thank you for you help. Thanks in advance.
OpenGl + C++
Eelco
Eelco
Quote:
Original post by bargasteh
1- divide the space into boxes and then do the collision only between those triangles that are in that space area (Box). if I do this then I have to reallocate triangles to each box.


possible, but that costs a lot of memory.

an awesome and imo heavily underestimated technique is to map this voxel space into a hashmap. linear memory requirement, linear searchtime and almost too easy to implement.
bargasteh
bargasteh
Can you please explain more a little bit ?
Is there any website or any resources that I could use ?

I appreciate this.
OpenGl + C++
Eelco
Eelco
there isnt too much online information in my experience unfortunately.

googling 'hash based collision detection' yields a couple of relevant results.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.