Package eas.math.geometry

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


        b.scale(Vector2D.NULL_VECTOR, new Vector2D(scale, scale));
        Vector2D pos = new Vector2D(fieldPos.x, fieldPos.y);

        if (env.getVisualizationAngleCenterPoint() != null) {
            pos.rotate(env.getVisualizationAngleCenterPoint(), env.getVisualizationAngleRAD());
        }

        pos.scale(Vector2D.NULL_VECTOR, new Vector2D(scale, scale));
        Vector2D midTranslation = new Vector2D(
                env.getScreenWidth() / 2,
View Full Code Here


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

      @Override
      public Integer sense(AbstractEnvironment2D<AbstractAgent2D<?>> env, AbstractAgent2D<?> agent) {
        int result = -1;
        Vector2D angle= new Vector2D(env.getNormalizedLOV(agent.id()).x,env.getNormalizedLOV(agent.id()).y);
        angle.rotate(Vector2D.NULL_VECTOR, -45+0*(90/(3-1.0))*Math.PI/180);

        CollisionData coll = env.nearestRayCollision(
            env.getAgentPosition(agent.id()),
            angle,
            agent);
View Full Code Here

      @Override
      public Integer sense(AbstractEnvironment2D<AbstractAgent2D<?>> env, AbstractAgent2D<?> agent) {
        int result = -1;
        Vector2D angle= new Vector2D(env.getNormalizedLOV(agent.id()).x,env.getNormalizedLOV(agent.id()).y);
        angle.rotate(Vector2D.NULL_VECTOR, -45+1*(90/(3-1.0))*Math.PI/180);

        CollisionData coll = env.nearestRayCollision(
            env.getAgentPosition(agent.id()),
            angle,
            agent);
View Full Code Here

      @Override
      public Integer sense(AbstractEnvironment2D<AbstractAgent2D<?>> env, AbstractAgent2D<?> agent) {
        int result = -1;
        Vector2D angle= new Vector2D(env.getNormalizedLOV(agent.id()).x,env.getNormalizedLOV(agent.id()).y);
        angle.rotate(Vector2D.NULL_VECTOR, -45+2*(90/(3-1.0))*Math.PI/180);

        CollisionData coll = env.nearestRayCollision(
            env.getAgentPosition(agent.id()),
            angle,
            agent);
View Full Code Here

    @Override
    public Double sense(AbstractEnvironment2D<AbstractAgent2D<?>> env, AbstractAgent2D<?> agent) {
      Vector2D angle= new Vector2D(env.getNormalizedLOV(agent.id()).x,env.getNormalizedLOV(agent.id()).y);
      if (numberOfDistanceSensors>1)
        angle.rotate(Vector2D.NULL_VECTOR, -45+sensorNumber*(90/(numberOfDistanceSensors-1.0))*Math.PI/180);
      Vector2D poi = env.nearestRayCollision(
          env.getAgentPosition(agent.id()),
          angle,
          agent).getCollisionPoint();
      if (poi == null) {
View Full Code Here

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

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

//        agent.v = new Vector2D(env.getAgentPosition(agent.id()));
//        lov.laengeFestlegen(100);
//        agent.v.add(lov);
        CollisionData collData;
View Full Code Here

      }
    }
   
    //construct sensor LOV
    Vector2D sensorLOV = env.getNormalizedLOV(body.id());
    sensorLOV.rotate(Vector2D.NULL_VECTOR, angleToAgent);
    sensorLOV.setLength(cSensorReach);
   
    LineSegment2D sensorLine = new LineSegment2D(
        new Vector2D(bodyPos),
        new Vector2D(bodyPos).translate(sensorLOV));
View Full Code Here

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

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

        CollisionData collData;
       
        if (isLight) {
            collData = env.nearestRayCollisionIgnoreNonColliding(
View Full Code Here

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

        lov.rotate(Vector2D.NULL_VECTOR, Math.PI);

        CollisionData collData;
       
        if (isLight) {
            collData = env.nearestRayCollisionIgnoreNonColliding(
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.