[This is preliminary documentation and is subject to change.]

Returns the centroid of a convex polygon.

Namespace: org.critterai.geom
Assembly: cai-util (in cai-util.dll) Version: 0.5.0.0 (0.5.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public static Vector3 GetCentroid(
	params Vector3[] vertices
)
Public Shared Function GetCentroid ( _
	ParamArray vertices As Vector3() _
) As Vector3
public:
static Vector3 GetCentroid(
	... array<Vector3>^ vertices
)

Parameters

vertices
array<Vector3>[]()[][]
An list of vertices that represent a polygon with an arbitrary number of sides. Wrap direction does not matter.

Return Value

The centroid of the polygon.

Remarks

Behavior is undefined if the polygon is not convex.

See Also