Sign in to follow this  

Simple Terrain Collision Detection

Recommended Posts

I was implementing an Octree for terrain collision. Then i thought why would i need an octree, a quadtree can do the job. as i am only dealing with terrains. so the structure of the octant leaf will hold the faces that octant intersects and the maximum height ( maximum Y ). the quadtree will be on the XZ plane. and we do not check an octant if we are above the maximum height. simple. After some implementation I came up with even a better idea (i suppose). Instead of a quadtree, i divide the 2D Grid into Tiles. So it will be a simple Tile system. each tile holds the list of faces it intersects with (xz plane only) and the maximum height. Now, this will make it very easy to test the collision. If i want to check if a point intersects the terrain. I will simply transform it to the tile's coordinate system. If it is above the maximum height => no collision. Else we check it with the faces in that tile... Well i said point in the above, it can be a bbox we check with the faces. simply a matter of changing from world coordinate to tile coordinate. Still implementing this but i think it would work with my project (a flight simulator). I would really like to know if i did not thing of something and what i said above is useless.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this