mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-05 22:09:52 +01:00
optimization
This commit is contained in:
parent
13f7db5986
commit
629b1f5164
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user