diff options
author | Sven Gothel <[email protected]> | 2012-05-16 16:47:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-16 16:47:30 +0200 |
commit | f86a7893490bc1295b6f8dfb1611c14645b00371 (patch) | |
tree | 0ff260ff03c75d234c0419a8f5709758a808b6a0 /src/jogl/classes/com/jogamp/graph/curve | |
parent | e1d954439572d7e6776c0d928d1882e1cf200675 (diff) |
Graph minor linear optimization: use vertexInTriangle3(..) reduces redundant computations
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve')
-rwxr-xr-x | src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java index f79dd6644..38b68702f 100755 --- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java +++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java @@ -449,15 +449,10 @@ public class OutlineShape implements Comparable<OutlineShape> { continue; } - { - final float[] coordA = a.getCoord(); - final float[] coordB = b.getCoord(); - final float[] coordC = c.getCoord(); - if(VectorUtil.vertexInTriangle(coordA, coordB, coordC, current.getCoord(), tempVecAC, tempVecAB, tempVecAP) || - VectorUtil.vertexInTriangle(coordA, coordB, coordC, nextV.getCoord(), tempVecAC, tempVecAB, tempVecAP) || - VectorUtil.vertexInTriangle(coordA, coordB, coordC, prevV.getCoord(), tempVecAC, tempVecAB, tempVecAP) ) { - return current; - } + if( VectorUtil.vertexInTriangle3(a.getCoord(), b.getCoord(), c.getCoord(), + current.getCoord(), nextV.getCoord(), prevV.getCoord(), + tempVecAC, tempVecAB, tempVecAP) ) { + return current; } if(VectorUtil.testTri2SegIntersection(a, b, c, prevV, current) || VectorUtil.testTri2SegIntersection(a, b, c, current, nextV) || |