Examples of dst()


Examples of com.badlogic.gdx.math.Vector2.dst()

      System.out.println("synchronize");
      for(NetworkShip ship:enemies) {
        if(ship.id.equalsIgnoreCase(id)) {
          System.out.println("synchronize " + ship.id)
          Vector2 networkPos = new Vector2(Float.parseFloat(positionx),Float.parseFloat(positiony));
          if(networkPos.dst(ship.body.getPosition())>1) {                           
            gameSession.networkUpdates.add(new UpdatePackage(ship, networkPos, Float.parseFloat(angle)));
          } else {
              networkPos.sub(ship.body.getPosition());
              Vector2 newPos = ship.body.getPosition().tmp().add(networkPos.mul(0.1f));
              gameSession.networkUpdates.add(new UpdatePackage(ship, newPos, Float.parseFloat(angle)));
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2.dst()

                      System.out.println("synchronize");
                      for(NetworkShip ship:enemies) {
                        if(ship.id.equalsIgnoreCase(obj.getString("player"))) {
                          System.out.println("synchronize " + ship.id)
                          Vector2 networkPos = new Vector2((float) obj.getJSONObject("message").getDouble("positionx"),(float) obj.getJSONObject("message").getDouble("positiony"));
                          if(networkPos.dst(ship.body.getPosition())>1) {                           
                            gameSession.networkUpdates.add(new UpdatePackage(ship, networkPos, (float)obj.getJSONObject("message").getDouble("angle")));
                          } else {
                            networkPos.sub(ship.body.getPosition());
                            Vector2 newPos = ship.body.getPosition().tmp().add(networkPos.mul(0.1f));
                            gameSession.networkUpdates.add(new UpdatePackage(ship, newPos, (float)obj.getJSONObject("message").getDouble("angle")));
View Full Code Here

Examples of com.badlogic.gdx.math.Vector3.dst()

  }

  @Override
  public void arrow (float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions) {
    Vector3 begin = tmp(x1, y1, z1), end = tmp(x2, y2, z2);
    float length = begin.dst(end);
    float coneHeight = length * capLength;
    float coneDiameter = 2 * (float)(coneHeight * Math.sqrt(1f / 3));
    float stemLength = length - coneHeight;
    float stemDiameter = coneDiameter * stemThickness;

 
View Full Code Here

Examples of com.badlogic.gdx.math.Vector3.dst()

  }

  @Override
  public void arrow (float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions) {
    Vector3 begin = tmp(x1, y1, z1), end = tmp(x2, y2, z2);
    float length = begin.dst(end);
    float coneHeight = length * capLength;
    float coneDiameter = 2 * (float)(coneHeight * Math.sqrt(1f / 3));
    float stemLength = length - coneHeight;
    float stemDiameter = coneDiameter * stemThickness;

 
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.