topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 4:10 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Collision Detection...  (Read 5697 times)

Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Collision Detection...
« on: July 13, 2008, 07:24 PM »
Anyone familiar with a good collision detection algorithm for 2 objects? Im messing around with a networked game atm.. bored, lol
CodeByter.com - http://www.codebyter.com

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Collision Detection...
« Reply #1 on: July 13, 2008, 07:32 PM »
i would suggest you use a graphics and phsysics library combo with support functions for this kind of thing.

Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Re: Collision Detection...
« Reply #2 on: July 13, 2008, 07:42 PM »
know anything good from personal experience?
CodeByter.com - http://www.codebyter.com

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Collision Detection...
« Reply #3 on: July 13, 2008, 07:43 PM »

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Collision Detection...
« Reply #4 on: July 13, 2008, 08:01 PM »
Split your world into sectors. Within each sector, start by doing an inexpensive initial test (usually bounding boxes or spheres), and for potential hits, possibly do a more correct (and expensive) test.

How to partition, how to do initial-test, and how to do expensive-test all depend on your game... 2D vs. 3D, data structures you use, etc.

But as mouser said, you might want to grab an existing engine unless you feel like doing your own collision detection for the sheer learning experience :)
- carpe noctem

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,778
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Collision Detection...
« Reply #5 on: July 13, 2008, 09:10 PM »
If you're working with 2D Objects, then Torque Game Builder should be a sufficient engine as far as collisions are concerned.

But it might be a little difficult to figure out the networking parts.