Package eas.math.geometry

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


    }
   
    for(double d = cSensorPrecision; d <= cSensorReach; d += cSensorPrecision){
     
      Vector2D sensorLOV = env.getNormalizedLOV(body.id());
      sensorLOV.rotate(Vector2D.NULL_VECTOR, angleToAgent);
      sensorLOV.setLength(d);
     
      //construct point on sonar line with a distance of D to body
      Vector2D sonarPoint = new Vector2D(sensorLOV).translate(bodyPos);
     
View Full Code Here


            }
        }
       
        Vector2D lov = new Vector2D(env.getNormalizedLOV(agent.id()));

        lov.rotate(Vector2D.NULL_VECTOR, 4 * Math.PI / 3);

        CollisionData collData;
        if (isLight) {
            collData = env.nearestRayCollisionIgnoreNonColliding(
                    env.getAgentPosition(agent.id()), lov, ignoreList);
View Full Code Here

            }
        }
       
        Vector2D lov = new Vector2D(env.getNormalizedLOV(agent.id()));

        lov.rotate(Vector2D.NULL_VECTOR, 2 * Math.PI / 3);
       
        CollisionData collData;
       
        if (isLight) {
            collData = env.nearestRayCollisionIgnoreNonColliding(
View Full Code Here

    Vector2D pos = new Vector2D(env.getAgentPosition(body.id()));
   
    //calculate offset
    Vector2D offsetLOV = env.getNormalizedLOV(body.id());
    offsetLOV.rotate(Vector2D.NULL_VECTOR, offset * Math.PI/2);
    offsetLOV.setLength(Math.abs(offset) * cOffset);
   
   
    //sensed point
    pos.translate(offsetLOV);
View Full Code Here

            sensRicht.setLength((Double) this.pars
                    .getParValue(Schleim.SLIME_SO_ATT));
            schleimVek.translate(sensRicht);
            return this.getTrailSoft((int) schleimVek.x, (int) schleimVek.y);
        } else if (sensor.equalsIgnoreCase("FR")) {
            sensRicht.rotate(Vector2D.NULL_VECTOR, -(Double) this.pars
                    .getParValue(Schleim.SLIME_RA_ATT)
                    / 180 * Math.PI);
            sensRicht.setLength((Double) this.pars
                    .getParValue(Schleim.SLIME_SO_ATT));
            schleimVek.translate(sensRicht);
View Full Code Here

            sensRicht.setLength((Double) this.pars
                    .getParValue(Schleim.SLIME_SO_ATT));
            schleimVek.translate(sensRicht);
            return this.getTrailSoft((int) schleimVek.x, (int) schleimVek.y);
        } else if (sensor.equalsIgnoreCase("FR")) {
            sensRicht.rotate(Vector2D.NULL_VECTOR, (Double) this.pars
                    .getParValue(Schleim.SLIME_RA_ATT)
                    / 180 * Math.PI);
            sensRicht.setLength((Double) this.pars
                    .getParValue(Schleim.SLIME_SO_ATT));
            schleimVek.translate(sensRicht);
View Full Code Here

        Vector2D middle = this.getMiddle(agentID);
       
        for (PacmanAgent2D p : this.agents.get(agentID).getAgents()) {
            Vector2D v = new Vector2D(this.getAgentPosition(p.id()));
            v.rotate(middle, (float) (-Math.PI / 2));
            if (!this.setAgentPosition(p.id(), v)) {
                this.resetToTempPositions();
                return false;
            }
        }
View Full Code Here

        if (angle == null) {
            return null;
        }
        angle = new Double(angle / 180 * Math.PI);
        vec = new Vector2D(0, 1);
        vec.rotate(Vector2D.NULL_VECTOR, angle);
        vec.norm();
        return vec;
    }
   
    /**
 
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.