checkpoint
[anneal.git] / src / edu / berkeley / qfat / geom / Point.java
index cf44573..b98fb2d 100644 (file)
@@ -3,7 +3,7 @@ import javax.media.opengl.*;
 import javax.media.opengl.glu.*;
 
 /** point in 3-space; immutable */
 import javax.media.opengl.glu.*;
 
 /** point in 3-space; immutable */
-public final class Point extends HasPoint implements HasBoundingBox {
+public final class Point implements HasBoundingBox, AffineConstraint, HasPoint {
 
     public static final Point ZERO = new Point(0,0,0);
 
 
     public static final Point ZERO = new Point(0,0,0);
 
@@ -33,5 +33,14 @@ public final class Point extends HasPoint implements HasBoundingBox {
     public float getMinY() { return y; }
     public float getMaxZ() { return z; }
     public float getMinZ() { return z; }
     public float getMinY() { return y; }
     public float getMaxZ() { return z; }
     public float getMinZ() { return z; }
+
+    public Point getProjection(Point p) { return this; }
+    public AffineConstraint intersect(AffineConstraint c, float epsilon) {
+        if (c.getProjection(this).distance(this) <= epsilon) return this;
+        System.err.println("off by: " + c.getProjection(this).distance(this));
+        return new AffineConstraint.Nothing();
+    }
+    public AffineConstraint multiply(Matrix m) { return m.times(this); }
+
 }
 
 }