Selaa lähdekoodia

Tweak to prevent tri_to_process.Last().m1 emptying.

legacy
Benjamin ‘Touky’ Huet touky 12 vuotta sitten
vanhempi
commit
ad275175b8
1 muutettua tiedostoa jossa 20 lisäystä ja 9 poistoa
  1. +20
    -9
      src/easymesh/csgbsp.cpp

+ 20
- 9
src/easymesh/csgbsp.cpp Näytä tiedosto

@@ -309,15 +309,26 @@ int CsgBsp::TestTriangleToTree(vec3 const &tri_v0, vec3 const &tri_v1, vec3 cons
//There was no triangle intersection, the complex case. //There was no triangle intersection, the complex case.
if (i == m_tree[leaf_idx].m_tri_list.Count()) if (i == m_tree[leaf_idx].m_tri_list.Count())
{ {
tri_to_process.Last().m1.Pop(); if (m_tree[leaf_idx].m_leaves[LEAF_FRONT] == LEAF_CURRENT &&

m_tree[leaf_idx].m_leaves[LEAF_BACK] == LEAF_CURRENT &&
//Register the triangle as needing to intersect with Front & back leaves. tri_to_process.Last().m1.Count() == 1)
if (m_tree[leaf_idx].m_leaves[LEAF_FRONT] != LEAF_CURRENT) {
tri_to_process.Last().m1.Push(m_tree[leaf_idx].m_leaves[LEAF_FRONT]); tri_list.Push(LEAF_CURRENT, tri_to_process.Last().m2, tri_to_process.Last().m3, tri_to_process.Last().m4);
if (m_tree[leaf_idx].m_leaves[LEAF_BACK] != LEAF_CURRENT) tri_to_process.Pop();
tri_to_process.Last().m1.Push(m_tree[leaf_idx].m_leaves[LEAF_BACK]); }
//Mark the triangle as needing point by point test else
tri_to_process.Last().m5 = 1; {
tri_to_process.Last().m1.Pop();

//Register the triangle as needing to intersect with Front & back leaves.
if (m_tree[leaf_idx].m_leaves[LEAF_FRONT] != LEAF_CURRENT)
tri_to_process.Last().m1.Push(m_tree[leaf_idx].m_leaves[LEAF_FRONT]);
if (m_tree[leaf_idx].m_leaves[LEAF_BACK] != LEAF_CURRENT)
tri_to_process.Last().m1.Push(m_tree[leaf_idx].m_leaves[LEAF_BACK]);
//Mark the triangle as needing point by point test

tri_to_process.Last().m5 = 1;
}
} }
//there was an intersection, so let's split the triangle. //there was an intersection, so let's split the triangle.
else else


||||||
x
 
000:0
Ladataan…
Peruuta
Tallenna