aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/curve
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-03-15 16:54:34 +0100
committerSven Gothel <[email protected]>2014-03-15 16:54:34 +0100
commit101567f5f16d91a13c8067764d5e14eefb2b9936 (patch)
treedd53040810d4728182962a6a6dc6ae96427741cf /src/jogl/classes/com/jogamp/graph/curve
parent06fbb390d28bc247945931699e1d59bdd76230c6 (diff)
FloatUtil/VectorUtil: Enhance isEqual/compare w/ and w/o epsilon, add unit tests - Cleanup VectorUtil (vec2/3 naming, remove dedundant functions)
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index 160e171e4..bac67eb5f 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -436,9 +436,9 @@ public class OutlineShape implements Comparable<OutlineShape> {
}
private void subdivideTriangle(final Outline outline, Vertex a, Vertex b, Vertex c, int index){
- VectorUtil.mid(tmpV1, a.getCoord(), b.getCoord());
- VectorUtil.mid(tmpV3, b.getCoord(), c.getCoord());
- VectorUtil.mid(tmpV2, tmpV1, tmpV3);
+ VectorUtil.midVec3(tmpV1, a.getCoord(), b.getCoord());
+ VectorUtil.midVec3(tmpV3, b.getCoord(), c.getCoord());
+ VectorUtil.midVec3(tmpV2, tmpV1, tmpV3);
//drop off-curve vertex to image on the curve
b.setCoord(tmpV2, 0, 3);
@@ -517,7 +517,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
continue;
}
- if( VectorUtil.vertexInTriangle3(a.getCoord(), b.getCoord(), c.getCoord(),
+ if( VectorUtil.isVec3InTriangle3(a.getCoord(), b.getCoord(), c.getCoord(),
current.getCoord(), nextV.getCoord(), prevV.getCoord(),
tmpV1, tmpV2, tmpV3) ) {
return current;
@@ -542,7 +542,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
final Vertex currentVertex = outline.getVertex(i);
final Vertex nextVertex = outline.getVertex((i+1)%vertexCount);
if ( !currentVertex.isOnCurve() && !nextVertex.isOnCurve() ) {
- VectorUtil.mid(tmpV1, currentVertex.getCoord(), nextVertex.getCoord());
+ VectorUtil.midVec3(tmpV1, currentVertex.getCoord(), nextVertex.getCoord());
final Vertex v = vertexFactory.create(tmpV1, 0, 3, true);
i++;
vertexCount++;
@@ -557,8 +557,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
}
if( vertexCount > 0 ) {
- if(VectorUtil.checkEquality(outline.getVertex(0).getCoord(),
- outline.getLastVertex().getCoord())) {
+ if(VectorUtil.isVec3Equal( outline.getVertex(0).getCoord(), 0, outline.getLastVertex().getCoord(), 0, FloatUtil.EPSILON )) {
outline.removeVertex(vertexCount-1);
}
}