Created
October 21, 2014 23:36
-
-
Save JonRurka/87af06e9e441068d00a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Vector3 CenterOfVectors( Vector3[] vectors ) | |
{ | |
Vector3 sum = Vector3.zero; | |
if( vectors == null || vectors.Length == 0 ) | |
{ | |
return sum; | |
} | |
foreach( Vector3 vec in vectors ) | |
{ | |
sum += vec; | |
} | |
return sum/vectors.Length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment