Permalink
Browse files

Fix wrong getFloor at Vector3 (#1332)

* Update Vector2.java

* Update Vector2f.java

* Update Vector3.java

* Update Vector3f.java

* Update Vector2f.java
  • Loading branch information...
1 parent 44c2a2c commit 14fcbe9003c7f678d8534a5bf032015905e77f22 @solo5star solo5star committed with MagicDroidX Dec 31, 2016
@@ -30,11 +30,11 @@ public double getY() {
}
public int getFloorX() {
- return (int) this.x;
+ return (int) Math.floor(this.x);
}
public int getFloorY() {
- return (int) this.y;
+ return (int) Math.floor(this.y);
}
public Vector2 add(double x) {
@@ -66,7 +66,7 @@ public Vector2 ceil() {
}
public Vector2 floor() {
- return new Vector2((int) this.x, (int) this.y);
+ return new Vector2((int) Math.floor(this.x), (int) Math.floor(this.y));
}
public Vector2 round() {
@@ -30,11 +30,11 @@ public float getY() {
}
public int getFloorX() {
- return (int) this.x;
+ return NukkitMath.floorFloat(this.x);
}
public int getFloorY() {
- return (int) this.y;
+ return NukkitMath.floorFloat(this.y);
}
public Vector2f add(float x) {
@@ -66,7 +66,7 @@ public Vector2f ceil() {
}
public Vector2f floor() {
- return new Vector2f((int) this.x, (int) this.y);
+ return new Vector2f(this.getFloorX(), this.getFloorY());
}
public Vector2f round() {
@@ -47,15 +47,15 @@ public double getZ() {
}
public int getFloorX() {
- return (int) this.x;
+ return (int) Math.floor(this.x);
}
public int getFloorY() {
- return (int) this.y;
+ return (int) Math.floor(this.y);
}
public int getFloorZ() {
- return (int) this.z;
+ return (int) Math.floor(this.z);
}
public double getRight() {
@@ -43,15 +43,15 @@ public float getZ() {
}
public int getFloorX() {
- return (int) this.x;
+ return NukkitMath.floorFloat(this.x);
}
public int getFloorY() {
- return (int) this.y;
+ return NukkitMath.floorFloat(this.y);
}
public int getFloorZ() {
- return (int) this.z;
+ return NukkitMath.floorFloat(this.z);
}
public float getRight() {

0 comments on commit 14fcbe9

Please sign in to comment.