Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Need help fixing a function I do not understand.

$
0
0
I have taken a function from the unity wiki, and converted it to C#.
http://wiki.unity3d.com/index.php?title=PolyContainsPoint

Here is my version:

Code (csharp):
  1.  
  2.     public bool PolyContainsPoint (Vector2[] polyPoints, Vector3 _point) {
  3.         Vector2 point = new Vector2 (_point.x, _point.y);
  4.         int j = polyPoints.Length-1;
  5.         bool inside = false;
  6.         for (int i = 0; i < polyPoints.Length; j = i++) {
  7.             if (((polyPoints[i].y <= point.y && point.y < polyPoints[j].y)...
Need help fixing a function I do not understand.

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>