Sign in to follow this  

Terrain collision help please

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

This topic is 4204 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.

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