Color Collision??

i just got this idea in my mind hope you read it all

so lets say we have 2 cubes 1 red and 1 blue

now if we could check if red Color intersects with blue Color and if it does the color purple stop moving?

have anybody tried this?

it just came to my mind by random, the idea can be improved ofcorse but would that save performance or?

How would comparing rgb values be any different from comparing mass x velocity?

i dunno :confused: just came to my mind out of absolutely no where

Visual-based collision… Not really practical, but very interesting idea!

for ex: if now this would work you could just add like 4 red pixels on the player that does not render and thats it!

Very inefficient. Do you ever wonder why you’ve never heard anyone talk about something like this? It’s because people have tried it, and realized it’s not as efficient as a math based approach.

I’m sure it’s still a good option in some case, just because you’ve never heard of it doesn’t mean you should rule it out. I think OP should try it out.

This is called collision masking among other names.
https://www.google.com/search?q=bitmask%20collision

Includes JGO post near the bottom :point:

Damn, JGO 2004 :stuck_out_tongue:
Anyways, I assumed he was talking about box2d-like physics, maybe too quickly.

I’m pretty sure the technique has existed since at least the 80s.

Yeah using bitmasks for 2d collision is pretty old. It is also nothing worth looking into imho.

I disagree. He may not use it, but it it’s still good to know. :wink:

yeajh tbanks for the response!

Pixel based collisions has used many times but they use bitmask not actual colors.

You could use the colors as directional representation of where it should push the one colliding with it to, and it’s alpha being the intesity. So you could do water as (0, 1, 0, 0.5) for up, and 0.5 being the intensity. If the alpha is 0, it could represent no collision.

And that would roughly be url=https://www.google.com/search?q=signed+distance+field+collision+detection distance fields[/url], albeit over-complicated. They are interesting because they do have practical uses, from text-rendering to pathfinding to (less practically) collision detection.

Those are not colors anymore but arbitary data.