Reputation:
Relating to this question i was wondering if .NET has any libs (or a function) i can use to detect if one point collides with another.
I am not sure what angles i should use but is there some function like this
func(point src, rect target, angle, distanceOfVision, listPointOrRectOfWalls)
Pretty unlikely but i dont know a formula or how to start. Its a quick and dirty prototype. I am thinking of writing the func but dropping angle making line of sight a rectangle and check if any wall points are between src and target.
Upvotes: 3
Views: 163
Reputation: 4950
I would solve the problem as such:
source_point + direction_vector * t
. If you set t = 1
you have two points defining your line. Upvotes: 3