aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/com/jogamp/math/VectorUtil.java9
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/Loop.java4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/jogl/classes/com/jogamp/math/VectorUtil.java b/src/jogl/classes/com/jogamp/math/VectorUtil.java
index 14f03ab93..05cb90d33 100644
--- a/src/jogl/classes/com/jogamp/math/VectorUtil.java
+++ b/src/jogl/classes/com/jogamp/math/VectorUtil.java
@@ -287,7 +287,6 @@ public final class VectorUtil {
return FloatUtil.isZero( determinant(v1, v2, v3) );
}
- public static final double InCircleDThreshold = DoubleUtil.EPSILON;
/**
* Check if vertices in triangle circumcircle given {@code d} vertex, from paper by Guibas and Stolfi (1985).
* <p>
@@ -300,7 +299,7 @@ public final class VectorUtil {
* @return true if the vertex d is inside the circle defined by the vertices a, b, c.
*/
public static boolean isInCircle(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) {
- return inCircleVal(a, b, c, d) > InCircleDThreshold;
+ return inCircleVal(a, b, c, d) > DoubleUtil.EPSILON;
}
public static double inCircleVal(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) {
// Operation costs:
@@ -525,7 +524,7 @@ public final class VectorUtil {
* @see #getWinding(List)
*/
public static boolean isCCW(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c){
- return triArea(a,b,c) > InCircleDThreshold;
+ return triArea(a,b,c) > DoubleUtil.EPSILON;
}
/**
@@ -541,7 +540,7 @@ public final class VectorUtil {
* @see #getWinding(List)
*/
public static Winding getWinding(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c) {
- return triArea(a,b,c) > InCircleDThreshold ? Winding.CCW : Winding.CW ;
+ return triArea(a,b,c) > DoubleUtil.EPSILON ? Winding.CCW : Winding.CW ;
}
/**
@@ -643,7 +642,7 @@ public final class VectorUtil {
final Vec3f plane3 = new Vec3f(plane);
final float tmp = ray.dir.dot(plane3);
- if ( Math.abs(tmp) < epsilon ) {
+ if ( FloatUtil.isZero(tmp, epsilon) ) {
return null; // ray is parallel to plane
}
result.set( ray.dir );
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
index 6f6b81a2f..a318bd555 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
@@ -31,6 +31,8 @@ import java.util.ArrayList;
import java.util.List;
import com.jogamp.graph.geom.Vertex;
+import com.jogamp.math.DoubleUtil;
+import com.jogamp.math.FloatUtil;
import com.jogamp.math.VectorUtil;
import com.jogamp.math.geom.AABBox;
import com.jogamp.math.geom.plane.Winding;
@@ -452,7 +454,7 @@ public class Loop {
egp.getPoint() != candPoint )
{
final double v = VectorUtil.inCircleVal(rootPoint, nextPoint, candPoint, egp.getPoint());
- if( v > VectorUtil.InCircleDThreshold ) {
+ if( v > DoubleUtil.EPSILON ) {
System.err.printf("Loop.isInCircle.1: %30.30f: %s, of%n- %s%n- %s%n- %s%n",
v, candPoint, rootPoint, nextPoint, egp.getPoint());
return null;