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

Function ImTriangleContainsPoint

KBotExt/imgui/imgui.cpp:1687–1693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1685}
1686
1687bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p)
1688{
1689 bool b1 = ((p.x - b.x) * (a.y - b.y) - (p.y - b.y) * (a.x - b.x)) < 0.0f;
1690 bool b2 = ((p.x - c.x) * (b.y - c.y) - (p.y - c.y) * (b.x - c.x)) < 0.0f;
1691 bool b3 = ((p.x - a.x) * (c.y - a.y) - (p.y - a.y) * (c.x - a.x)) < 0.0f;
1692 return ((b1 == b2) && (b2 == b3));
1693}
1694
1695void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w)
1696{

Callers 2

ColorPicker4Method · 0.85
BeginMenuExMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected