Jump to content
  • Advertisement
Sign in to follow this  
THACO

intersection / Collision detection

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

Ok, my game is going to be 2d in controls, but rendered in 3d. Player can go up down, left or right. Currently I export the bounding lines, and would use those to test against the line segment for the movement over one timestep. I can easily add a third vert to make it a triangle/plane to do plane to line collision detection, or I could just do line to line collision detection. Is one more efficient than another? For using planes, I would just test the distance, via dot product? and if it is positive, it is on one side, if it is negative, and if zero, it is on the plane? That is fairly simple, but for line intersection in 2d, I have to worry about horizontle lines, verticle lines and make them special cases. So even though I only need 2d, should I go with 3D because it shoudl be easier to implement? Thanks -THACO

Share this post


Link to post
Share on other sites
Advertisement
Don't have a complete answer for you, but just wanted to mention that the special cases you mention are only an issue when representing lines in slope-intercept form. Google for 'line intersection' and you will find other algorithms which are more general.

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!