bug hunting

This commit is contained in:
zzzzrrr 2009-08-14 16:37:04 -04:00
parent 41e40241a1
commit 00b91269b1
2 changed files with 6 additions and 6 deletions

View File

@ -87,7 +87,7 @@ class Poly2TriDemo extends BasicGame("Poly2Tri") {
val i18 = "data/i.18"
val tank = "data/tank.dat"
var currentModel = star
var currentModel = strange
var doCDT = true
var mouseButton = 0

View File

@ -134,7 +134,6 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
if(i == CDT.clearPoint) {cleanTri = node.triangle; mesh.debug += cleanTri}
// Process edge events
point.edges.foreach(e => edgeEvent(e, node))
} catch {
case e: Exception =>
//throw new Exception("Suspect point = " + i)
@ -184,9 +183,13 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
val tList = new ArrayBuffer[Triangle]
tList += firstTriangle
while(!tList.last.contains(edge.p))
// Not sure why tList.last is null sometimes....
while(tList.last != null && !tList.last.contains(edge.p))
tList += tList.last.findNeighbor(edge.p - edge.q)
if(tList.last == null)
tList -= tList.last
// Neighbor triangles
val nTriangles = new ArrayBuffer[Triangle]
@ -239,9 +242,6 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
aFront.constrainedEdge(sNode, eNode, T1, T2, edge)
// Mark edge triangle neighbors
//T1.foreach(t => t.markNeighbor(eTri))
} else if(firstTriangle == null) {
// No triangles are intersected by the edge; edge must lie outside the mesh