MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / buildPathFromShape

Function buildPathFromShape

TheForceEngine/TFE_Polygon/polygon.cpp:972–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970 }
971
972 void buildPathFromShape(const std::vector<Vec2f>& shape, ClipperLib::Path& outPath)
973 {
974 const f64 precision = c_toFixed;
975 const s32 vtxCount = (s32)shape.size();
976 const Vec2f* vtx = shape.data();
977
978 outPath.resize(shape.size());
979 ClipperLib::IntPoint* outVtx = outPath.data();
980 for (s32 v = 0; v < vtxCount; v++, vtx++, outVtx++)
981 {
982 outVtx->X = ClipperLib::cInt((f64)vtx->x * precision);
983 outVtx->Y = ClipperLib::cInt((f64)vtx->z * precision);
984 }
985 }
986
987 void buildContoursFromPaths(const ClipperLib::Paths& paths, s32 outsideClipCount, std::vector<Contour>* contourList)
988 {

Callers 1

cleanUpShapeFunction · 0.85

Calls 3

dataMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected