Jump to content
  • Advertisement
Sign in to follow this  

Terrain collision help please

This topic is 4507 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

Hi, Im trying to implement collisions for my entities against my terrain. I developed my terrain using the techniques provided here. I have done the following to find out which cell I am currently in within the terrain: int dx = GetPlayerPtr()->GetPosition().m_x - minbounds.x; int dz = GetPlayerPtr()->GetPosition().m_z - minbounds.z; int cellx = dx / stepx; int cellz = dz / stepz; My problem is I cannot seem to think how I can retrieve the height data from the terrain via knowning the cell (I tryed looping through the vertex buffer using a cell count but this seemed to be incorrect). It is probably simple and I just havent realised it yet :(. My terrain uses a heightmap. thx for any help Mike

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!