MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImBezierCubicClosestPointCasteljau

Function ImBezierCubicClosestPointCasteljau

KBotExt/imgui/imgui.cpp:1664–1672  ·  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

1662// tess_tol is generally the same value you would find in ImGui::GetStyle().CurveTessellationTol
1663// Because those ImXXX functions are lower-level than ImGui:: we cannot access this value automatically.
1664ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol)
1665{
1666 IM_ASSERT(tess_tol > 0.0f);
1667 ImVec2 p_last = p1;
1668 ImVec2 p_closest;
1669 float p_closest_dist2 = FLT_MAX;
1670 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);
1671 return p_closest;
1672}
1673
1674ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p)
1675{

Callers

nothing calls this directly

Tested by

no test coverage detected