Open ata6502 opened 3 months ago
I have verified that the CheckSharesVertsOrCoplanar
method may incorrectly indicate that the input triangles share a vertex even if the triangles are disjoined i.e., they do not share any edges or vertices. For example:
// ABC and DEF triangles are disjoined.
// Triangle ABC.
XMVECTOR A = XMVectorSet(1.f, 1.f, 1.f, 0.f);
XMVECTOR B = XMVectorSet(2.f, 1.f, 1.f, 0.f);
XMVECTOR C = XMVectorSet(1.f, 2.f, 1.f, 0.f);
// Triangle DEF.
XMVECTOR D = XMVectorSet(2.f, 2.f, 1.f, 0.f);
XMVECTOR E = XMVectorSet(2.f, 3.f, 1.f, 0.f);
XMVECTOR F = XMVectorSet(1.f, 3.f, 1.f, 0.f);
// The method returns sharesEdgeOut = true
Also, the naming of the method and local variables is inconsistent:
Hi, There is a
CheckSharesVertsOrCoplanar
method in theTriangle
class (C++/Shared/Primitives.h
) that claims to test if two triangles share an edge. After examination of the method, I have found that the method returns true even if the triangles share a single vertex, for example:In spite of that the application is working fine. Could it be that the comment at the top of the method is incorrect (it reads "Tests this triangle against another one to see if it shares any edges") or is it a genuine bug?