Examples of normalise()


Examples of org.lwjgl.util.vector.Vector3f.normalise()

    this.fieldOfView = Math.max(10, Math.min(100, fov));
  }
 
  public void lookAt(float x, float y, float z){
    Vector3f forward = new Vector3f(x-this.position.x, y-this.position.y, z-this.position.z);
    forward.normalise();

    this.rotation.x = (float) Math.toDegrees(Math.asin(-forward.y));
    this.rotation.y = (float) Math.toDegrees(Math.PI/2+Math.atan2(forward.z, forward.x));
  }
}
View Full Code Here

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

    for (int i = 0; i < 5; i++) //[10..90] - 75/5
    {
      rotation[i] = (short) new Random().nextInt(360);
      direction[i] = new Random().nextBoolean();
      vector = new Vector2f(x,y);
      vector.normalise();
      vector.setTheta(new Random().nextInt(32)-170+32*i);
      x_off[i] = vector.getX();
      y_off[i] = vector.getY();
    }
  }
View Full Code Here

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

  public Vector2f getDirection() {
    Vector2f d = new Vector2f();
    d.x = end.x - start.x;
    d.y = end.y - start.y;
    return d.normalise();
  }

  public void render(Graphics g) {
    g.draw(line);
  }
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.