Jump to content
  • Advertisement
Sign in to follow this  
Ripiz

C++, DirectX9, collision with .x terrain?

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

Hello. I've been searching on Google but haven't managed to find, how to detect collision between .x model (either it's position) and .x terrain. I think it has something with getting height of terrain at X, Y coordinates, but I'm not sure how. Maybe anyone could help?

Share this post


Link to post
Share on other sites
Advertisement
There isn't a collision detection system built into DirectX or C++.

You can consider one of the D3DXIntersect functions to determine the relative positions of one mesh with another. If you're strictly interested in height-above-terrain that would be your best bet.

Otherwise you may want to use one of several collision/physics engines available around the web (Havok, Bullet, ODE, etc.).

Share this post


Link to post
Share on other sites
Well thanks for reply
Appears rotation of terrain didn't apply when detecting collision, so it wasn't right, after rotating model in editor, not in code it became all fine.

Thanks again

Share this post


Link to post
Share on other sites
Still, you should read all the height data from the model and store it in a local vector/array, to avoid having to read from agp memory :)

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!