2D Ray intersect with rectangle on square grid?

Looking for an efficient way to do a ray (2D line segment defined by start and end points) intersection test with a single square on a regular grid (for a raycaster)..what i need to return is the 2D x,y point of intersection (if there is one)

I’ve done a bunch of searches and found a lot of answers that seem too complicated for this problem..this seems to be a very simple case, so there should be a fast robust solution…

Published by CelleSports

CelleSports is a Game development, News outlet, and Social Cell community. Build your cells or teams for any game and start communicating efficiently. Join us in building the number one eSport and gaming community in the World. Join Cell eSports

Leave a comment