Jump to content

Image collision


Karoffe

Recommended Posts

You know the size and position of the image since you made it. Image 1 is at 100x100 and is 250x250 so its coordinates are 100x100, 100x350, 350x350, 350x100. Image 2 is at 351x100 and is 100x100 wide, so its coordinates are 351x100, 451x100, 451x200, 351x200. They are 1 pixel apart, therefor touching. Or if some of the coordinates are between two others, they could be considered overlapped.

Link to comment

Problem is these would work if the images are not in rotation, so that way will work when the bounding boxes touches eachother, I want it to be with the image itself, Anyways i personally thought of doing your way easier by getDistanceBetweenPoints2D.. but still won't work with rotated images

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...