Comments and answers for "What does bounds.sqrdistance do?"
http://answers.unity.com/questions/1591384/what-does-boundssqrdistance-do.html
The latest comments and answers for the question "What does bounds.sqrdistance do?"Answer by dan_wipf
http://answers.unity.com/answers/1591404/view.html
Ok *Bounds.SqrDistance(Vector 3 point)* is equal for example to this:
float SmallestDistance = Vector3.Distance(Vector3_Point,GetComponent<Renderer>().bounds.ClosestPoint(Vector3_Point));
float BoundsSqrDistance = SmallestDistance * SmallestDistance;
so to be clear. *Bounds.SqrDistance(Vector3 point)* does makes a new Square between the closest Point of a Boundary Box and a given Vector3 point and as Result you get a Distance² float between the closest Point of a BB and a given Vector3 point.
So you could break it down to get the actual distance, if you'd do a Square Root * √ * Mathf function like this:
float acutal distance = Mathf.Sqrt(GetComponent<Renderer>().Bounds.SqrDistance(point);
Let me know if this is the kind of Wisdom you've searched for.Fri, 18 Jan 2019 07:35:36 GMTdan_wipf