This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Functions | |
{ | |
float distLine(float2 p, float2 a, float2 b) { | |
float2 ap = p - a; | |
float2 ab = b - a; | |
float aDotB = clamp(dot(ap, ab) / dot(ab, ab), 0.0, 1.0); | |
return length(ap - ab * aDotB); | |
} | |
float drawLine(float2 uv, float2 a, float2 b) { |