- public Point glProject(GL gl) {
- Point p = this;
- int viewport[] = new int[4];
- double mvmatrix[] = new double[16];
- double projmatrix[] = new double[16];
- double wcoord[] = new double[4];
- gl.glGetIntegerv(GL.GL_VIEWPORT, viewport, 0);
- gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, mvmatrix, 0);
- gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projmatrix, 0);
- GLU glu = new GLU();
- glu.gluProject(p.x, p.y, p.z, mvmatrix, 0, projmatrix, 0, viewport, 0, wcoord, 0);
- return new Point(wcoord[0], wcoord[1], 0);
+ public Point getProjection(Point p) { return this; }
+ public AffineConstraint intersect(AffineConstraint c, float epsilon) {
+ Point p2 = c.getProjection(this);
+ if (p2==null) return AffineConstraint.NONE;
+ if (p2.distance(this) <= epsilon) return this;
+ return AffineConstraint.NONE;