C4 Engine
C4 Engine API Documentation

Calc::ConvexPolygon

Defined in:  C4Computation.h
Returns a boolean value indicating whether a given polygon is convex.
Prototype

bool ConvexPolygon(int32 vertexCount, const Point3D *vertex, const Vector3D& normal);

Parameters
vertexCount The number of vertices defining the boundary of the polygon. This must be at least 3.
vertex An array containing the vertices of the polygon, wound in counterclockwise order.
normal The normal direction of the polygon.
Description
The ConvexPolygon function returns true if the polygon defined by the vertexCount and vertex parameters is convex. If the polygon is concave or has three consecutive collinear vertices, then the return value is false.
See Also

Calc::PointInConvexPolygon

Calc::GetPolygonArea