Package eas.math.geometry

Examples of eas.math.geometry.Vector2D.translate()


                pinkBorder.getBoundingBox().upperLeftCorner().y));
       
        pos.x = pos.x / env.globalScale();
        pos.y = pos.y / env.globalScale();
       
        pos.translate(box.upperLeftCorner());
       
        if (env.getVisualizationAngleCenterPoint() != null) {
            pos.rotate(env.getVisualizationAngleCenterPoint(), -env.getVisualizationAngleRAD());
        }
       
View Full Code Here


        // Selektion.
        @SuppressWarnings("rawtypes")
        Vector2D liob = new Vector2D(((AbstractEnvironment2D) this.getEnvironment()).getAgentPosition(this.id()));
        Vector2D reun = new Vector2D(liob);
        liob.sub(new Vector2D(this.kantenLaenge, this.kantenLaenge));
        reun.translate(new Vector2D(this.kantenLaenge, this.kantenLaenge));
       
        Rectangle2D box = new Rectangle2D(liob, reun);
        @SuppressWarnings({ "rawtypes", "unchecked" })
        List<Integer> idList = ((AbstractEnvironment2D) this.getEnvironment()).calculateAgentsInBox(box);
        List<Evolvable<AbstractEvolvableAgent2D<AbstractEnvironment2D<?>>>> jasmineList = new ArrayList<Evolvable<AbstractEvolvableAgent2D<AbstractEnvironment2D<?>>>>(idList.size());
View Full Code Here

                break;
            }
           
            Vector2D pos = new Vector2D((agent.getEnvironment()).getAgentPosition(agent.id()));
           
            pos.translate(new Vector2D(
                    xVersch * ConstantsSimulation.SCHRITTW,
                    yVersch * ConstantsSimulation.SCHRITTW));
           
            if ((agent.getEnvironment()).setAgentPosition(
                    agent.id(), pos)) {
View Full Code Here

        Rectangle2D bdb = this.env.getBoundingBox(false);
        Vector2D envSizeTrans = new Vector2D(bdb.middle());
        envSizeTrans.div(-1);
       
        Vector2D fieldPos = new Vector2D(fieldPos2.x, fieldPos2.y);
        fieldPos.translate(envSizeTrans);
       
        Vector3D fieldPos3D = new Vector3D(
                (fieldPos.x) * 10 / (Math.abs(fieldPos.y) + 12),
                (fieldPos.y) * 10 / (Math.abs(fieldPos.x) + 12),
                0);
View Full Code Here

       
        Vector2D pos2 = new Vector2D(
                pos.x / 10 * (Math.abs(pos.y) + 12),
                pos.y / 10 * (Math.abs(pos.x) + 12));

        pos2.translate(envSizeTrans);
       
        return pos2;
    }
}
View Full Code Here

                }
            });
           
            wholeAgent.addPartAgent(agent);
            Vector2D pos = new Vector2D(position);
            pos.translate(v);
           
            float angle;
            if (!agentType.equals("normal")) {
                angle = 0;
            } else {
View Full Code Here

    private void lowerBomb() {
        Vector2D pos = new Vector2D(this.getAgentPosition(this.bombAgent.id()));
        this.setAgentPosition(
                this.bombAgent.id(),
                pos.translate(new Vector2D(0, 1)));
    }
   
    private void agentLowerCompletelyRight() {
        this.agentLowerCompletely(this.getCurrentAgentID(), false);
        while (this.agentRight()) {
View Full Code Here

       
        env.removeAllAgents();
       
        for (Vector2D v : this.vecs) {
            Vector2D v2 = new Vector2D(v);
            v2.translate(new Vector2D(minX, minY));
            env.addAgent(new DummyAgent(0, env, this.pars, Color.orange), new Vector2D(v2), 0);
        }
       
        env.setPerfectFit(true);
        env.setScreenHeight(200);
View Full Code Here

    @Override
    public Vector2D getPositionInVisualization(int agentID) {
        try {
            Vector2D pos = new Vector2D(this.getAgentPosition(agentID));
            pos.mult(this.fac);
            pos.translate(new Vector2D(this.fac / 2, this.fac / 2));
            return pos;
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

        }
        tileTurned.rotate(Vector2D.NULL_VECTOR, angle);
       
        for (Vector2D p : tileTurned) {
            Vector2D gesPos = new Vector2D(pos);
            gesPos.translate(p);
            this.setPix((int) Math.round(gesPos.x), (int) Math.round(gesPos.y), color);
        }
    }
   
    @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.