this is one thing i've never been able to code correctly. maybe im doing it too hard. can anyone wite up a little code to show
mayebe 2 circles or squares or somethig
even lines
or even a good basic tutorial
i need a good, basic concept here
thanks
This is a discussion on basic collision detection within the Game Programming forums, part of the General Programming Boards category; this is one thing i've never been able to code correctly. maybe im doing it too hard. can anyone wite ...
this is one thing i've never been able to code correctly. maybe im doing it too hard. can anyone wite up a little code to show
mayebe 2 circles or squares or somethig
even lines
or even a good basic tutorial
i need a good, basic concept here
thanks
In 2D, or 3D? 2D is easy...3D is what we like to call "a $$$$$."![]()
For 2D with circles, keep track of the center and radius of each circle (easy). Use the distance formula (3d version, with a bit of other info) to find the distance between the two centers of the circles. If this distance is <= (radius1 + radius2), collision.
Away.
Yes, you need to understand vectors. works easy in 2D or 3D. This is how "real" games do it. Simply use a plane intercept equation to find where one "plane" meets another.
It is not the spoon that bends, it is you who bends around the spoon.