Package net.sf.fysix.math

Examples of net.sf.fysix.math.Vector2d.sub()


    return 0;
  }

  public Vector2d getGravity(Vector2d pos) {
    Vector2d dist = new Vector2d(centerPoint.getX(), centerPoint.getY());
    dist.sub(pos);
    if (dist.length() > 0 && dist.length() < 250) {
      dist.scale(100.0/dist.length());
      return dist;
    } else {
      return new Vector2d(0, 0);
View Full Code Here


    this.world = world;
  }

  public void scrollTo(Vector2d v, double dt) {
    Vector2d tmp = new Vector2d(v);
    tmp.sub(center);
    double dist = tmp.length();
    center.addScaled(dist * dt / 1000, tmp);
  }
 
  public boolean wantNormalizedCoordinates() {
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.