MCPcopy Create free account
hub / github.com/cinder/Cinder / ImTriangleContainsPoint

Function ImTriangleContainsPoint

src/imgui/imgui.cpp:2010–2016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2008}
2009
2010bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p)
2011{
2012 bool b1 = ((p.x - b.x) * (a.y - b.y) - (p.y - b.y) * (a.x - b.x)) < 0.0f;
2013 bool b2 = ((p.x - c.x) * (b.y - c.y) - (p.y - c.y) * (b.x - c.x)) < 0.0f;
2014 bool b3 = ((p.x - a.x) * (c.y - a.y) - (p.y - a.y) * (c.x - a.x)) < 0.0f;
2015 return ((b1 == b2) && (b2 == b3));
2016}
2017
2018void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w)
2019{

Callers 3

IsEarMethod · 0.85
ColorPicker4Method · 0.85
BeginMenuExMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected