Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Vector2f.distance()


    return getDistance(new Vector2f(other.x, other.y));
  }

  public float getDistance(Vector2f otherPos) {
    Vector2f myPos = new Vector2f(x, y);
    return myPos.distance(otherPos);
  }

  public static Vector2f calculateVector(float angle, float magnitude) {
    Vector2f v = new Vector2f();
    v.x = (float) Math.sin(Math.toRadians(angle));
View Full Code Here


   * @see org.newdawn.slick.geom.TexCoordGenerator#getCoordFor(float, float)
   */
  public Vector2f getCoordFor(float x, float y) {
    Vector2f result = new Vector2f();
    line.getClosestPoint(new Vector2f(x,y), result);
    float u = result.distance(start);
    u /= line.length();
   
    return new Vector2f(u,0);
  }
 
View Full Code Here

    gradient.getTransform().transform(rt, 0, rt, 0, 1);
    trans.transform(rt, 0, rt, 0, 1);
   
    centre = new Vector2f(c[0],c[1]);
    Vector2f dis = new Vector2f(rt[0],rt[1]);
    radius = dis.distance(centre);
  }

  /**
   * @see org.newdawn.slick.geom.TexCoordGenerator#getCoordFor(float, float)
   */
 
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.