• Advertisement
Sign in to follow this  

Heightmaps for terrain collision(C#) n00b Q'

This topic is 4871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had a great idea last night about using my heightmap for collsion detection ... then i searched on here this morning and realised it wasn't a great idea, i just came to a logical conclusion that every ones already been doing for yonks :? . Although i searched i couldnt find the answer to a few simple questions i have about it. 1. Should i get the player location on the map and refference it against the hight data from the .RAW file OR from the already generated Mesh? 2. If i Access the mesh & If i store my terrain in a locked buffer at the moment, will it mean that i have to unlock it (and take a performance hit) to reference it for the collision detection? 3.When i eventualy use thse mind boggling algorithms to simplify the mesh not near my players FOV how will this effect the terrain collision of entities in the distance walking on simplified terrain?

Share this post


Link to post
Share on other sites
Advertisement
As for 1. and 2., I have done it by loading the raw heightmap into an array, and generating the mesh from it. For collisions, you don't have to touch your mesh, just interpolate from your height array.

A thing to note would be to make sure you interpret the heightmap the same way you render it, making it triangular the same way.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement