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

Function ImBezierQuadraticCalc

tutorials/common/imgui/imgui_draw.cpp:1227–1234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1225}
1226
1227ImVec2 ImBezierQuadraticCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t)
1228{
1229 float u = 1.0f - t;
1230 float w1 = u * u;
1231 float w2 = 2 * u * t;
1232 float w3 = t * t;
1233 return ImVec2(w1 * p1.x + w2 * p2.x + w3 * p3.x, w1 * p1.y + w2 * p2.y + w3 * p3.y);
1234}
1235
1236// Closely mimics ImBezierCubicClosestPointCasteljau() in imgui.cpp
1237static void PathBezierCubicCurveToCasteljau(ImVector<ImVec2>* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)

Callers 1

Calls 1

ImVec2Function · 0.85

Tested by

no test coverage detected