Package eas.math.geometry

Examples of eas.math.geometry.Polygon2D


    private Polygon2D shape;
   
    @Override
    public synchronized Polygon2D getAgentShape() {
        if (shape == null) {
            shape = new Polygon2D();
//            shape.add(new Vector2D(0, 1));
            shape.add(new Vector2D(-0.025, -0.25));
            shape.add(new Vector2D(-0.025, 0.25));
            shape.add(new Vector2D(0.025, 0.25));
            shape.add(new Vector2D(0.025, -0.25));
View Full Code Here


    private Polygon2D shape;
   
    @Override
    public synchronized Polygon2D getAgentShape() {
        if (shape == null) {
            shape = new Polygon2D();
//            shape.add(new Vector2D(0, 1));
            shape.add(new Vector2D(0.3, -1));
            shape.add(new Vector2D(1.25, 13));
            shape.add(new Vector2D(0, 23));
            shape.add(new Vector2D(-1.25, 13));
View Full Code Here

  }

  @Override
    public Polygon2D getAgentShape() {
    if (shape == null) {
      shape = new Polygon2D();
      shape.add(new Vector2D(0.5, 0.5));
      shape.add(new Vector2D(-0.5, 0.5));
      shape.add(new Vector2D(-0.5, -0.5));
      shape.add(new Vector2D(0.5, -0.5));
    }
View Full Code Here

    private Polygon2D shape;
   
    @Override
    public synchronized Polygon2D getAgentShape() {
        if (shape == null) {
            shape = new Polygon2D();
//            shape.add(new Vector2D(0, 1));
            shape.add(new Vector2D(0.2, -2.5));
            shape.add(new Vector2D(0.1, 22));
            shape.add(new Vector2D(-0.1, 22));
            shape.add(new Vector2D(-0.2, -2.5));
View Full Code Here

    private Polygon2D shape;
   
    @Override
    public Polygon2D getAgentShape() {
        if (this.shape == null) {
            this.shape = new Polygon2D();
            this.shape.add(new Vector2D(-10, -10));
            this.shape.add(new Vector2D(10, -10));
            this.shape.add(new Vector2D(10, 10));
            this.shape.add(new Vector2D(-10, 10));
        }
View Full Code Here

    private Polygon2D shape;
   
    @Override
    public synchronized Polygon2D getAgentShape() {
        if (shape == null) {
            shape = new Polygon2D();
//            shape.add(new Vector2D(0, 1));
            shape.add(new Vector2D(-0.25, 0));
            shape.add(new Vector2D(-0.25, 1));
            shape.add(new Vector2D(0.25, 1));
            shape.add(new Vector2D(0.25, 0));
View Full Code Here

        super(id, env, params);
    }
   
    @Override
    public Polygon2D getAgentShape() {
        Polygon2D pol = new Polygon2D();
        Vector2D vec1 = new Vector2D(-1, 0);
        Vector2D vec2 = new Vector2D(0, 0);
        Vector2D vec3 = new Vector2D(1, 0);
        Vector2D vec4 = new Vector2D(2, 0);
        pol.add(vec1);
        pol.add(vec2);
        pol.add(vec3);
        pol.add(vec4);
        return pol;
    }
View Full Code Here

    @Override
    public Polygon2D getAgentShape() {
        if (pacman == null) {
            final double precision = 40;
            final double radius = 1;
            pacman = new Polygon2D();
           
            for (double d = 0; d < Math.PI * 1.75; d += Math.PI * 2 / precision) {
                pacman.add(new Vector2D(Math.sin(d) * radius, Math.cos(d) * radius));
            }
            pacman.add(new Vector2D(0, 0));
View Full Code Here

        if (this.bombRunning) {
            Vector2D bombpos = this.getAgentPosition(this.bombAgent.id());
            g.setColor(Color.red);
            g.setStroke(new BasicStroke(2));
           
            Polygon2D line1 = new Polygon2D();
            line1.add(new Vector2D(-epsilon, bombpos.y + epsilon));
            line1.add(new Vector2D(this.getGridWidth() - epsilon, bombpos.y + epsilon));
           
            Polygon2D line2 = new Polygon2D();
            line2.add(new Vector2D(-epsilon, bombpos.y - this.bombs + epsilon));
            line2.add(new Vector2D(this.getGridWidth() - epsilon, bombpos.y - this.bombs + epsilon));
           
            g.drawPolygon(this.getPolygonInVisualization(line1).toPol());
            g.drawPolygon(this.getPolygonInVisualization(line2).toPol());
        }
       
View Full Code Here

        super(id, env, params);
    }
   
    @Override
    public Polygon2D getAgentShape() {
        Polygon2D pol = new Polygon2D();
        Vector2D vec1 = new Vector2D(-1, 0);
        Vector2D vec2 = new Vector2D(0, 0);
        Vector2D vec3 = new Vector2D(1, 0);
        Vector2D vec4 = new Vector2D(0, 1);
        pol.add(vec1);
        pol.add(vec2);
        pol.add(vec3);
        pol.add(vec4);
        return pol;
    }
View Full Code Here

TOP

Related Classes of eas.math.geometry.Polygon2D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.