Unity3D에서 선과 직선의 거리 구하기. [ Calculate the distance between a ray and a point. ]
public static float DistanceToLine(Ray ray, Vector3 point) 
{ 
	return Vector3.Cross(ray.direction, point - ray.origin).magnitude; 
}


.....This article is posted by whitesnake.
1 ··· 11 12 13 14 15 16 17 18 19 ··· 176