Called to triangulate the N-gon in ngon, returning the result in pPolys.
Here is part of a trivial example of a triangulation algorithm that preserves quads:
#define AllocPolys(_p) lPolyCount = (_p); pPolys = (CPolygon*)NewMemClear((_p) * sizeof(CPolygon)); if (!pPolys) return false;
{
{
AllocPolys(1);
bTriang = true;
return true;
}
else if (ngon->
count == 4)
{
AllocPolys(1);
bTriang = true;
return true;
}
else
{
...
}
}
- Parameters
-
[in] | pObj | An initialized object. |
[in] | lNgonID | The N-gon ID of ngon. |
[in] | ngon | The N-gon to triangulate. |
[in] | pvPoints | The points of pObj. |
[in] | lPointCount | The array size of pvPoints. |
[out] | pPolys | Always nullptr in the call. Assign the resulting triangulated polygon array here.
It should be an array of CPolygon, allocated with NewMemClear(). The caller takes over the ownership of the pointed array. |
[out] | lPolyCount | Assign the size of pPolys here. |
[in] | bTriang | Assign true if ngon was triangulated, otherwise false. |
[in] | pData | The private hook data, passed from Modeling::SetTriangulateHook(). |
- Returns
- true if successful, otherwise false.