public void draw(GOut g) { Coord2d mc = MapView.pllastcc; if (mc == null) return; Gob gob = (Gob) owner; Coord3f pc = gob.getc(); double lcx = mc.x; double lcy = mc.y; double x = lcx - pc.x; double y = -lcy + pc.y; double z = Math.sqrt(x * x + y * y) >= 44 * 11 ? 0 : gob.glob.map.getcz(lcx, lcy) - pc.z; g.apply(); BGL gl = g.gl; gl.glLineWidth(2.0F); gl.glEnable(GL2.GL_BLEND); gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA); gl.glEnable(GL2.GL_LINE_SMOOTH); gl.glHint(GL2.GL_LINE_SMOOTH_HINT, GL2.GL_NICEST); gl.glBegin(GL2.GL_LINES); gl.glVertex3f(0, 0, 0); gl.glVertex3f((float) x, (float) y, (float) z); gl.glEnd(); gl.glDisable(GL2.GL_LINE_SMOOTH); }
public void prect(Coord c, Coord ul, Coord br, double a) { st.set(cur2d); apply(); gl.glEnable(GL2.GL_POLYGON_SMOOTH); gl.glBegin(GL.GL_TRIANGLE_FAN); vertex(c); vertex(c.add(0, ul.y)); double p2 = Math.PI / 2; all: { float tc; tc = (float) (Math.tan(a) * -ul.y); if ((a > p2) || (tc > br.x)) { vertex(c.x + br.x, c.y + ul.y); } else { vertex(c.x + tc, c.y + ul.y); break all; } tc = (float) (Math.tan(a - (Math.PI / 2)) * br.x); if ((a > p2 * 2) || (tc > br.y)) { vertex(c.x + br.x, c.y + br.y); } else { vertex(c.x + br.x, c.y + tc); break all; } tc = (float) (-Math.tan(a - Math.PI) * br.y); if ((a > p2 * 3) || (tc < ul.x)) { vertex(c.x + ul.x, c.y + br.y); } else { vertex(c.x + tc, c.y + br.y); break all; } tc = (float) (-Math.tan(a - (3 * Math.PI / 2)) * -ul.x); if ((a > p2 * 4) || (tc < ul.y)) { vertex(c.x + ul.x, c.y + ul.y); } else { vertex(c.x + ul.x, c.y + tc); break all; } tc = (float) (Math.tan(a) * -ul.y); vertex(c.x + tc, c.y + ul.y); } gl.glEnd(); gl.glDisable(GL2.GL_POLYGON_SMOOTH); checkerr(); }
public void unapply(GOut g) { BGL gl = g.gl; gl.glDisable(mode); }
public void unapply(GOut g) { BGL gl = g.gl; gl.glDisable(GL2.GL_FOG); }
public void unapply(GOut g) { BGL gl = g.gl; gl.glSampleCoverage(1.0f, false); gl.glDisable(GL.GL_SAMPLE_COVERAGE); }