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

Function buildShapeFromPath

TheForceEngine/TFE_Polygon/polygon.cpp:1016–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1014 }
1015
1016 void buildShapeFromPath(const ClipperLib::Path& path, std::vector<Vec2f>& outShape)
1017 {
1018 const f64 precision = c_fromFixed;
1019 const s32 vtxCount = (s32)path.size();
1020 const ClipperLib::IntPoint* vtx = path.data();
1021
1022 outShape.resize(vtxCount);
1023 Vec2f* outVtx = outShape.data();
1024
1025 for (s32 v = 0; v < vtxCount; v++, vtx++, outVtx++)
1026 {
1027 outVtx->x = f32((f64)vtx->X * precision);
1028 outVtx->z = f32((f64)vtx->Y * precision);
1029 }
1030 }
1031
1032 void buildContoursFromPolygon(const BPolygon* poly, std::vector<Contour>* contours)
1033 {

Callers 1

cleanUpShapeFunction · 0.85

Calls 3

dataMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected