Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Per pixel collision

Name: Anonymous 2011-03-21 10:45

Is there any way to do per pixel collision on objects that are moving with a high velocity other than stepping through every pixel of movement and checking for collision?

Name: Anonymous 2011-03-21 11:03

http://stackoverflow.com/questions/1112676/continuous-collision-detection-between-two-moving-tetrahedra

I don't think a closed-form expression exists. You'll probably have to use an iterative method.

I know you mentioned pixels in your question, but that's just going to be slow as fuck.

Name: Anonymous 2011-03-21 11:14

Not really, but you can optimize the collision checking that happens before it.
Divide your objects into few hitboxes - one main hitbox covering the whole object, 4 smaller (1/4 size of the original one), maybe repeat few times more (depending on the size of objects).
That way you'll discard more ``false positives'' from the main hitbox before the whole per-pixel (costly as love) check.
If your objects are very ``sparse'' (low density), you can recurse this 4-division thing (wiki: Quadtrees) until you get single pixels.

Things I assume (won't work well without those):
-your objects don't usually contain other objects - they collide mostly on the outside
-you don't need to know which pixels collide (you can make a full, brute check after you're sure some do, though)
-your objects aren't too ``geometric'' (elliptic, polygonal) - in this case you'd better use less generic algorithm for each case

Name: Anonymous 2011-03-21 11:53

TOO BAD RUBY IS SLOW AS LOVE

Name: Anonymous 2011-03-21 12:13

>>4
ALL YOU NEED IS SLOW

Name: Anonymous 2011-03-21 12:15

>>5
What is slow?
Baby don't interpret me.

Name: Anonymous 2011-03-21 13:09

>>6

love you faggot

Name: Anonymous 2011-03-21 13:40

>>7
OKAY YOU JUST LOVIN ANGERED AN EXPERT PROGRAMMER

Name: Anonymous 2011-03-21 16:11

>>7
Love back to /b/, please.

Name: sage 2011-03-21 18:26

if you have the velocities of the pixels you can do a check for collisions on direction change.

Name: Anonymous 2011-03-21 19:53

<$&

Name: Anonymous 2011-03-27 5:03

The motherfucking PATRICK COLLISION.

Don't change these.
Name: Email:
Entire Thread Thread List