Package eas.math.geometry

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


        if (isTargetOnSameLane()) {
            return false;
        }
       
        Vector2D dirToTarget = new Vector2D(this.targetLocation);
        dirToTarget.sub(this.getAgentPosition());
        return !this.getNormalizedLOV().drehrichtung(dirToTarget);
    }

    public boolean isTargetOnSameLane() {
        int posX = (int) this.getAgentPosition().x;
View Full Code Here


        if (isTargetOnSameLane()) {
            return true;
        }

        Vector2D dirToTarget = new Vector2D(this.targetLocation);
        dirToTarget.sub(this.getAgentPosition());
        return this.getNormalizedLOV().drehrichtung(dirToTarget);
    }

    public boolean isTargetAhead() {
        return new Vector2D(this.getAgentPosition()).add(this.getNormalizedLOV()).distance(this.targetLocation) <
View Full Code Here

            try {
                g.setColor(Color.red);
                double height = 25;
                double width = 25;
                Vector2D agPos = ((AbstractEnvironment2D) this.currentEnv).getPointInVisualization(((AbstractEnvironment2D) this.currentEnv).getAgentPosition(this.markedAgentId));
                agPos.sub(new Vector2D(width / 2, height / 2));
                g.drawOval((int) agPos.x, (int) agPos.y, (int) (width), (int) (height));
               
                Polygon2D pol2D = ((AbstractEnvironment2D) this.currentEnv).getAgentShapeInVisualization(this.markedAgentId);
                Polygon pol = pol2D.toPol();
                g.setColor(Color.red);
View Full Code Here

    @Override
    public void mouseDragged(MouseEvent e) {
        LiveWindow.this.vidParent.setFollowAgent(false);
        if (isHand && handStartingPoint != null) {
            Vector2D midVector = new Vector2D(handStartingPoint);
            midVector.sub(new Vector2D(e.getPoint()));
            vidParent.adjustZoomBoxMiddle(midVector);
            handStartingPoint = new Vector2D(e.getPoint());
        } else {
            try {
                LiveWindow.this.zoomRechteck.setRight(e.getX() - LiveWindow.this.getInsets().left);
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.