[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(
	Vector3[] vertices,
	int startVert,
	int vertCount
)
Public Shared Function GetCentroid ( _
	vertices As Vector3(), _
	startVert As Integer, _
	vertCount As Integer _
) As Vector3
public:
static Vector3 GetCentroid(
	array<Vector3>^ vertices, 
	int startVert, 
	int vertCount
)

Parameters

vertices
array<Vector3>[]()[][]
An array of vertices that contains a representation of a polygon with an arbitrary number of sides. Wrap direction does not matter.
startVert
Int32
The index of the first vertex in the polygon.
vertCount
Int32
The number of vertices in the polygon.

Return Value

The centroid of the polygon.

Remarks

Behavior is undefined if the polygon is not convex.

See Also