- Home /
Question by
Ocean257 · Apr 15, 2017 at 08:18 AM ·
unity 5boundspolygon collider 2d
How Does Unitys PolygonCollider2D calculates its center ??
How Does Unitys PolygonCollider2D calculates its center ?? How is PolygonCollider2d.Bounds.center
Calculated ? I googled but did not found any thing I used barycenter of polyline and barycenter of polygon but that is not what unitys polygonCollider2D uses ..
Comment
Answer by Ocean257 · Apr 17, 2017 at 07:32 PM
Well i founded the solution first sort the vertices in x coord and y coord sperately and then do (xmin + xmax)/2,(ymin + ymax)/2