Jump to content
  • Advertisement
Sign in to follow this  
Beaverbutt8

Terrain "gravity" collision

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

Hey guys, Recently, i figured out bounding box collision ( YAY!!! ). Then, last night i figured out how to fix the apron tutorials 3ds loader so that it would work. well, awesome. Now i have another question. Since i have 5 years of experience with 3ds max, i can make terrain without a problem. So here's my question - how can i program "gravity" collision on terrain? Thanks Mike

Share this post


Link to post
Share on other sites
Advertisement
Collision detection is collision detection regardless of how the object is moving - you don't care about motion at that point. What you want to do typically is do a trial movement of something, run collision detection, and if it collides with something, then do some kind of collision response (and possibly do some different movement for that object in the current update).

As for collision detection "against terrain", it really depends on the geometry of your terrain (and your objects) and how detailed you want to get. The simplest thing is to just consider the point which is 'lowest' on the object (smallest z), and see if it will be below the terrain's height at that (x,y) location.

Share this post


Link to post
Share on other sites
I am not experienced in this area, but I expect you'd split the map into matrixes (not opengl matrixes, i mean like a grid) and process terrain collision only forthe terrain matrix that applies to the object's location, so the fact that the terran has a lot of polygons is irrelevant because only the poly's around the object in question are taken into consideration, which would lower i guess the number of checks you'd need to do to find the lowest point on the terrain.

however, i could be completely wrong and i'm not even concerned with 3D physics for my games :P

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!