optimization

This commit is contained in:
Mason 2009-08-16 18:27:47 -04:00
parent 13f7db5986
commit 629b1f5164
2 changed files with 7 additions and 4 deletions

View File

@ -87,7 +87,7 @@ class Poly2TriDemo extends BasicGame("Poly2Tri") {
val i18 = "data/i.18"
val tank = "data/tank.dat"
var currentModel = nazcaHeron
var currentModel = nazcaMonkey
var doCDT = true
var mouseButton = 0
@ -97,7 +97,7 @@ class Poly2TriDemo extends BasicGame("Poly2Tri") {
var mousePosOld = Point(0, 0)
var deltaX = 0f
var deltaY = 0f
var scaleFactor = 1f
var scaleFactor = 0.85f
var gameContainer: GameContainer = null

View File

@ -405,7 +405,10 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
val point = t1.points(0)
val oPoint = t2 oppositePoint t1
if(illegal(t1.points(1), t1.points(0), t1.points(2), oPoint) && !t2.finalized) {
// Pints are oriented ccw
val illegal = Util.incircle(t1.points(1), t1.points(2), t1.points(0), oPoint)
if(illegal && !t2.finalized) {
// Flip edge and rotate everything clockwise
t1.legalize(oPoint)