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.
강의자료/Unity3D | 2011. 7. 18. 13:36

댓글을 달아 주세요

1 ··· 11 12 13 14 15 16 17 18 19 ··· 176