General Collision Detection

Started by
6 comments, last by Kwizatz 15 years, 9 months ago
Yeah so, I was thinking of ways to do this and from what i've seen having a tree would optimize this. Even if you have a low-res poly detection-mesh, chopping the detection into sub sections with a 'tree' would really speed things up. At first I was thinking only having one pre-requisite check, that being a radius. Obviously that would work but not be very sufficient I think. But of course doing this isn't easy. I would prefer to program an automation to this, which I might have to do. The obvious choice would be to give a parameter of n number of 'levels' and then just select areas based on overall amount of polys in that area. So that they are evenly distributed and each is the same amount of work for a cpu task. So, do you think this optimization is fundamental?
Advertisement
In most cases yes, and you seem to want to implement an Octree
As I undertsand it the oct-tree is the only way to do it, or a variation of an oct-tree where nothing else seems viable at this point.
There is also BSPs and ABTs (Adaptive Binary Trees) by our very own Yann L
Well this is pretty much what I was thinking of (ABTs I mean). Cause I thought, why 8 subsections? Why not 2? And the ambiguity of it all makes it confusing really.
2 would make calculations easier especially when some of the faces (they mean polygons?) may be well condensed in one area. Although atm I heavily disagree with having the volumes roughly equal. Maybe this is because he is using this for occlusion and not collision detection.
I don't know much about ABTs myself, I use BSPs, but from what I read on More OpenGL Game Programming, the volumes are not the same, the splitting plane is placed in such a way that both sides are balanced in terms of number of primitives and number of primitives needed to be split (I think there is a third parameter considered), so it doesn't cut spaces at their exact half.
I read some on 'BSP'. It mainly talks about forming convex structures out of concave. This is from wiki...

I considered forming boundaries out of structures that are non-cubical. I suppose you could do this, but I think at a minimum the faces must be parallel, or atleast keep 6 sides only. With the limited information provided from wiki, there isn't much to differentiate BSP from Octree with the same goal in mind, 3d Collision.
They both solve the same problem in a different way if that's what you mean by "the same", they are quite different in implementation, Octree's being easier to implement.

Faces don't need to be cubical on a BSP, they need to be convex, in example a pentagon is a valid convex face or polygon.

This topic is closed to new replies.

Advertisement