C4 Engine
C4 Engine API Documentation

Calc::GetPolygonArea

Defined in:  C4Computation.h
Returns the signed area of a polygon.
Prototype

float GetPolygonArea(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.
normal The normal direction of the polygon.
Description
The GetPolygonArea function returns the signed area of a polygon whose vertices are given by the vertexCount and vertex parameters. If the vertices are wound counterclockwise about the normal direction, then the returned area is positive. If the vertices are wound clockwise, then the returned area is negative. The polygon does not need to be convex.
See Also

Calc::ConvexPolygon

Calc::PointInConvexPolygon