My game is in 3D environment partitioned with 2D grids in 2 dimensioned array
So I can get any cell/node by passing row and col like return _nodes[r][c]
.
When the an attacker attacks an enemy with ranged weapon, I want to check if there is any obstacle in between the two points.
Without using mesh collision methods, I want to achieve it by checking all the cells which falls between the source and target points and check if there are any obstacles.
I want to write this in a routine which will return false as soon as it finds an obstacle and returns true if it finds no obstacle in any of the cells between the source and target
From the above picture, I want to get yellow that falls between the two end points
Can some one suggest me the approach?