Package javax.vecmath

Examples of javax.vecmath.Vector2d


    public void mouseDrag(Point2d worldCoordFrom, Point2d worldCoordTo) {
      end2DCenter = worldCoordTo;
        Point2d atomCoord = new Point2d();
        atomCoord.add(worldCoordTo, offset);

        Vector2d d = new Vector2d();
        d.sub(worldCoordTo, worldCoordFrom);

        chemModelRelay.moveBy(atomsToMove, d, null);
        chemModelRelay.updateView();
    }
View Full Code Here


        chemModelRelay.updateView();
    }

  public static Point2d roundAngle(Point2d s,Point2d d, double bondLength) {

        Vector2d v = new Vector2d();
        v.sub( d, s );
        double rad = Math.atan2(v.y,v.x);
        double deg = Math.toDegrees( rad );
        deg = Math.round( deg/15)*15;
        rad = Math.toRadians( deg );
        v.x = bondLength*Math.cos( rad );
View Full Code Here

  {
  }

  public void collisionOccured(CollisionEvent paramCollisionEvent)
  {
    this.a.a(new d(b.a(this.b, paramCollisionEvent.getBodyA().getID()), b.a(this.b, paramCollisionEvent.getBodyB().getID()), new Vector2d(paramCollisionEvent.getPoint().getX(), paramCollisionEvent.getPoint().getY()), new Vector2d(paramCollisionEvent.getNormal().getX(), paramCollisionEvent.getNormal().getY())));
  }
View Full Code Here

    return localObject;
  }

  public static com.a.b.b a(Body paramBody)
  {
    return new com.a.b.b(Long.valueOf(paramBody.getID()), paramBody.getName(), paramBody.getPosition().getX(), paramBody.getPosition().getY(), paramBody.getRotation(), new Vector2d(paramBody.getVelocity().getX(), paramBody.getVelocity().getY()), paramBody.getAngularVelocity(), new Vector2d(paramBody.getForce().getX(), paramBody.getForce().getY()), paramBody.getTorque(), paramBody.getDamping(), paramBody.getRotDamping(), paramBody.getRestitution(), paramBody.getFriction(), paramBody.getMass(), a(paramBody.getShape()), paramBody.isStatic());
  }
View Full Code Here

    this.a = paramLong;
    this.b = paramString;
    this.c = paramDouble1;
    this.d = paramDouble2;
    this.e = paramDouble3;
    this.f = (paramVector2d1 == null ? null : new Vector2d(paramVector2d1));
    this.g = paramDouble4;
    this.h = (paramVector2d2 == null ? null : new Vector2d(paramVector2d2));
    this.i = paramDouble5;
    this.k = paramDouble6;
    this.l = paramDouble7;
    this.m = paramDouble8;
    this.n = paramDouble9;
View Full Code Here

  private void a(g paramg, Graphics paramGraphics, double paramDouble1, double paramDouble2, int paramInt)
  {
    if (paramInt >= 10)
      return;
    double d = 2.5D * paramInt;
    Vector2d[] arrayOfVector2d = { new Vector2d(paramDouble1 + 1.0D * d, paramDouble2), new Vector2d(paramDouble1 + 0.2D * d, paramDouble2 + 0.2D * d), new Vector2d(paramDouble1, paramDouble2 + 1.0D * d), new Vector2d(paramDouble1 - 0.2D * d, paramDouble2 + 0.2D * d), new Vector2d(paramDouble1 - 1.0D * d, paramDouble2), new Vector2d(paramDouble1 - 0.2D * d, paramDouble2 - 0.2D * d), new Vector2d(paramDouble1, paramDouble2 - 1.0D * d), new Vector2d(paramDouble1 + 0.2D * d, paramDouble2 - 0.2D * d) };
    int i = arrayOfVector2d.length;
    int[] arrayOfInt1 = new int[i];
    int[] arrayOfInt2 = new int[i];
    for (int j = 0; j < i; j++)
    {
      Vector2d localVector2d = a(arrayOfVector2d[j], paramg);
      arrayOfInt1[j] = ((int)localVector2d.x);
      arrayOfInt2[j] = ((int)localVector2d.y);
    }
    paramGraphics.drawPolygon(new Polygon(arrayOfInt1, arrayOfInt2, i));
  }
View Full Code Here

    Integer localInteger1 = (Integer)paramj.a("crewHealthDelta");
    if ((localInteger1 != null) && (localInteger1.intValue() != 0))
    {
      double d1 = paramj.a() - 25.0D - 10.0D;
      double d3 = paramj.b() - 25.0D - 2.0D * paramj.d();
      Vector2d localVector2d1 = a(new Vector2d(d1, d3), paramg);
      if (localInteger1.intValue() > 0)
      {
        paramGraphics.setColor(Color.GREEN);
        paramGraphics.drawString("+" + localInteger1, (int)localVector2d1.x, (int)localVector2d1.y);
      }
      else
      {
        paramGraphics.setColor(Color.RED);
        paramGraphics.drawString(String.valueOf(localInteger1), (int)localVector2d1.x, (int)localVector2d1.y);
      }
    }
    Integer localInteger2 = (Integer)paramj.a("hullDurabilityDelta");
    if ((localInteger2 != null) && (localInteger2.intValue() != 0))
    {
      double d2 = paramj.a() + 25.0D - 10.0D;
      double d4 = paramj.b() - 25.0D - 2.0D * paramj.d();
      Vector2d localVector2d2 = a(new Vector2d(d2, d4), paramg);
      paramGraphics.setColor(Color.BLUE);
      if (localInteger2.intValue() > 0)
        paramGraphics.drawString("+" + localInteger2, (int)localVector2d2.x, (int)localVector2d2.y);
      else
        paramGraphics.drawString(String.valueOf(localInteger2), (int)localVector2d2.x, (int)localVector2d2.y);
View Full Code Here

    paramGraphics.setColor(localColor);
  }

  private void d(g paramg, Graphics paramGraphics)
  {
    Vector2d localVector2d1 = a(new Vector2d(15.0D, 0.0D), paramg);
    paramGraphics.setFont(new Font("Courier New", 0, Ints.checkedCast(StrictMath.round(localVector2d1.x))));
    if (paramg.f().length > 0)
      a(paramg, paramGraphics, 20.0D, 30.0D, paramg.f()[0]);
    if (paramg.f().length > 1)
      a(paramg, paramGraphics, 20.0D, 60.0D, paramg.f()[1]);
    if (paramg.f().length > 2)
      a(paramg, paramGraphics, 235.0D, 30.0D, paramg.f()[2]);
    if (paramg.f().length > 3)
      a(paramg, paramGraphics, 235.0D, 60.0D, paramg.f()[3]);
    if (paramg.f().length > 4)
      a(paramg, paramGraphics, 450.0D, 30.0D, paramg.f()[4]);
    if (paramg.f().length > 5)
      a(paramg, paramGraphics, 450.0D, 60.0D, paramg.f()[5]);
    Vector2d localVector2d2 = a(new Vector2d(paramg.d() - 50.0D, paramg.e() - 30.0D), paramg);
    paramGraphics.drawString(String.valueOf(paramg.b()), (int)localVector2d2.x, (int)localVector2d2.y);
  }
View Full Code Here

    paramGraphics.drawString(String.valueOf(paramg.b()), (int)localVector2d2.x, (int)localVector2d2.y);
  }

  private void a(g paramg, Graphics paramGraphics, double paramDouble1, double paramDouble2, i parami)
  {
    Vector2d localVector2d = a(new Vector2d(paramDouble1, paramDouble2), paramg);
    paramGraphics.drawString(String.format("%-17s: %d", new Object[] { (parami.c() ? "? " : "") + parami.a(), Integer.valueOf(parami.b()) }), (int)localVector2d.x, (int)localVector2d.y);
  }
View Full Code Here

    return a(paramVector2d, 0.0D, 0.0D, paramn.d(), paramn.e(), this.a.getWidth(), this.a.getHeight());
  }

  private void a(Graphics paramGraphics, n paramn, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    Vector2d localVector2d1 = a(new Vector2d(paramDouble1, paramDouble2), paramn);
    Vector2d localVector2d2 = a(new Vector2d(paramDouble3, paramDouble4), paramn);
    paramGraphics.drawLine((int)localVector2d1.x, (int)localVector2d1.y, (int)localVector2d2.x, (int)localVector2d2.y);
  }
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector2d

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.