Package javax.vecmath

Examples of javax.vecmath.Point2d


  /**
   * {@inheritDoc}
   */
  @Override
  public Point2d getPosition() {
    return new Point2d(this.position);
  }
View Full Code Here


      }
    });
   
    this.world.addMouseMotionListener(new MouseMotionListener() {
      public void mouseDragged(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }
      public void mouseMoved(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }     
    });
   
    this.world.addMouseListener(new MouseListener() {
      public void mouseClicked(MouseEvent e) {
        //
      }
      public void mouseEntered(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }
      public void mouseExited(MouseEvent e) {
        setMouseTarget(null);
      }
      public void mousePressed(MouseEvent e) {
View Full Code Here

    return this.isSteering ? getMaxAngularAcceleration() : getMaxAngularSpeed();
  }

  @Override
  public Status live() {
    Point2d position = new Point2d(getX(), getY());
    Vector2d orientation = getDirection();
    double linearSpeed = getCurrentLinearSpeed();
    double angularSpeed = getCurrentAngularSpeed();
   
    BehaviourOutput output = null;
View Full Code Here

  }
 
  private boolean dig(LemmingBody iLemmingBody, Direction iDirection)
  {
    boolean rIsASuccess = false;
    Point2d agentPos = iLemmingBody.getPosition();
    double agentHeight = iLemmingBody.getHeight();
    double agentWidth = iLemmingBody.getWidth();
    boolean isActing = iLemmingBody.getIsActing();
   
    Floor floorToDig = null;
View Full Code Here

  }
 
  private void makeBridge(LemmingBody body)
  {
    WorldModel worldModel = world.get();
    Point2d position = body.getPosition();
    worldModel.getFloor(position.x + body.getWidth() + 1, position.y + body.getHeight() + 1);
    if(indexOfFloor == -1)
    {
      worldModel.addFloor(new Floor(body.getWidth() + 2, 20, position.x + body.getWidth()- 1, position.y + body.getHeight() - 1));
    }
View Full Code Here

 
  private void digHorizontally(LemmingBody body)
  {
    WorldModel worldModel = (WorldModel) world.get();
    Floor floorToDig;
    Point2d agentPosition = body.getPosition();
    double agentHeight = body.getHeight();
    double agentWidth = body.getWidth();
    floorToDig = worldModel.getFloor(agentPosition.x + agentWidth/2,
        agentPosition.y + agentHeight/2);
   
View Full Code Here

      }
    });
   
    this.world.addMouseMotionListener(new MouseMotionListener() {
      public void mouseDragged(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }
      public void mouseMoved(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }     
    });
   
    this.world.addMouseListener(new MouseListener() {
      public void mouseClicked(MouseEvent e) {
        //
      }
      public void mouseEntered(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }
      public void mouseExited(MouseEvent e) {
        setMouseTarget(null);
      }
      public void mousePressed(MouseEvent e) {
View Full Code Here

  public static boolean hasStructure(IMolecule mol) {
    //System.out.println("CheckNull");
    if(mol == null) return false;
    //System.out.println("CheckOneAtom");
    if(mol.getAtomCount() < 2) return true;
    Point2d origin = new Point2d(0.0, 0.0);
    //System.out.println("CheckAtoms");
    for(int i=0;i<mol.getAtomCount();i++) {
      Point2d p = mol.getAtom(i).getPoint2d();
      //System.out.println(mol.getAtom(i).getPoint2d());
      if(p != null && !origin.equals(p)) return true;
    }
    //System.out.println("CheckedAtoms");
    return false;
View Full Code Here

    }
  }
 
  private IMolecule combineMolecules(IMolecule molA, IMolecule molB) throws Exception {
    //GeometryTools.t
    GeometryToolsInternalCoordinates.translate2DCenterTo(molA, new Point2d(0,0));
    GeometryToolsInternalCoordinates.translate2DCenterTo(molB, new Point2d(0,0));
     
    /* XY - minX, minY, maxX, maxY */
    double [] interXY = GeometryToolsInternalCoordinates.getMinMax(molA);
    double [] outputXY = GeometryToolsInternalCoordinates.getMinMax(molB);
           
View Full Code Here

    newAtomVector.sub(refVect);
   
    // Translate back
    newAtomVector.add(start);
   
    return new Point2d(newAtomVector);
  }
View Full Code Here

TOP

Related Classes of javax.vecmath.Point2d

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.