|
![]() |
|
| Author |
|
|||||||
|
Khel
Posts: 10733
Location: Wynnum, Queensland
|
Well, I figure theres some smart people here, someone may know the answer I need :) I'm basically just looking for a simple way to do collision detection between a circle and a rectangle in 2d. I can do collision detection between two circles, by comparing the sum of their radii with the distance between their centres, and collision between two rectangles is easy enough, but I just can't seem to get my head around how to do collision between a circle and a rectangle.
I tried googling, but most of the stuff that came up was usually way more complicated than what I need, or was about ways of optimising collision detection. I dont really care at this point if its not incredibly optimised, I just want to figure out how to do it first =\ |
|||||||
| #0 09:32pm 15/10/05 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
BoBa
Cainer
Posts: 2064
Location: Brisbane, Queensland
|
does this help? it's in vb though http://www.rookscape.com/vbgaming/tutBU.php
|
|||||||
| #1 09:36pm 15/10/05 |
|
|||||||
|
Persay
Posts: 3433
Location: Brisbane, Queensland
|
how do you describe your rectangle?
|
|||||||
| #2 09:45pm 15/10/05 |
|
|||||||
|
Khel
Posts: 10734
Location: Wynnum, Queensland
|
Thats perfect, thanks. I guess my google skills just suck.
The shame, to be saved by a VB example :( last edited by Khel at 21:49:22 15/Oct/05 |
|||||||
| #3 09:49pm 15/10/05 |
|
|||||||
|
BoBa
Cainer
Posts: 2066
Location: Brisbane, Queensland
|
haha pwned by google!
|
|||||||
| #4 09:51pm 15/10/05 |
|
|||||||
|
Jim
Posts: 3806
Location: Brisbane, Queensland
|
if you bought a 4wd you wouldn't give a s*** about what you collided with
|
|||||||
| #5 09:51pm 15/10/05 |
|
|||||||
|
Mantra
Posts: 1385
Location: Brisbane, Queensland
|
The shame, to be saved by a VB example :(Much roffling at this :) |
|||||||
| #6 10:47pm 15/10/05 |
|
|||||||
|
Obes
Posts: 3734
Location: Brisbane, Queensland
|
I run into small children with my 4wd ... they fit nicely under the wheels
|
|||||||
| #7 11:08pm 15/10/05 |
|
|||||||
|
Obes
Posts: 3735
Location: Brisbane, Queensland
|
ps. you really must suck at google
seems to list a heap of preferred algorithms for collision detection I imagine if you plug those names into google you'll get much better results. Pivot2D seems to be popular from the few minutes google work I did. pps. do your own damn homework! |
|||||||
| #8 11:24pm 15/10/05 |
|
|||||||
|
typo
Posts: 4500
Location: Brisbane, Queensland
|
run into small children with my 4wd ... they fit nicely under the wheels They would have to be real small children too fit under there. I mean like asian small ... |
|||||||
| #9 01:25am 16/10/05 |
|
|||||||
|
Obes
Posts: 3736
Location: Brisbane, Queensland
|
Its not that I am racists but they are the only ones that fit under there nicely.
|
|||||||
| #10 01:35am 16/10/05 |
|
|||||||
|
AdamtehGreat
Posts: 676
Location: Brisbane, Queensland
|
if you bought a 4wd you wouldn't give a s*** about what you collided with That has to be the stupidest post I have seen on QGL to date. Congrats. |
|||||||
| #11 03:15am 16/10/05 |
|
|||||||
|
Xy
Posts: 329
Location: Mackay, Queensland
|
Semi-trailer > 4WD
|
|||||||
| #12 03:36am 16/10/05 |
|
|||||||
|
Hardball, Billy
Posts: 4979
Location: Brisbane, Queensland
|
this thread sucks
|
|||||||
| #13 03:43am 16/10/05 |
|
|||||||
|
system
|
--
|
|||||||
| #13 |
|
|||||||
|
| ||||||||