MCPcopy Create free account
hub / github.com/RenderKit/embree / ImBezierCubicClosestPointCasteljau

Function ImBezierCubicClosestPointCasteljau

tutorials/common/imgui/imgui.cpp:1559–1567  ·  view source on GitHub ↗

tess_tol is generally the same value you would find in ImGui::GetStyle().CurveTessellationTol Because those ImXXX functions are lower-level than ImGui:: we cannot access this value automatically.

Source from the content-addressed store, hash-verified

1557// tess_tol is generally the same value you would find in ImGui::GetStyle().CurveTessellationTol
1558// Because those ImXXX functions are lower-level than ImGui:: we cannot access this value automatically.
1559ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol)
1560{
1561 IM_ASSERT(tess_tol > 0.0f);
1562 ImVec2 p_last = p1;
1563 ImVec2 p_closest;
1564 float p_closest_dist2 = FLT_MAX;
1565 ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, tess_tol, 0);
1566 return p_closest;
1567}
1568
1569ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p)
1570{

Callers

nothing calls this directly

Tested by

no test coverage detected