Sign in to follow this  
Ripiz

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

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
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

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