Added //move and //moveair.

This commit is contained in:
sk89q
2010-10-18 13:51:43 -07:00
parent ca2ed71805
commit a34f977b94
3 changed files with 116 additions and 0 deletions

View File

@ -446,6 +446,32 @@ public class Vector {
Math.pow(pt.z - z, 2));
}
/**
* Checks to see if a vector is contained with another.
*
* @param min
* @param max
* @return
*/
public boolean containedWithin(Vector min, Vector max) {
return x >= min.getX() && x <= max.getX()
&& y >= min.getY() && z <= max.getY()
&& z >= min.getZ() && z <= max.getY();
}
/**
* Checks to see if a vector is contained with another.
*
* @param min
* @param max
* @return
*/
public boolean containedWithinBlock(Vector min, Vector max) {
return getBlockX() >= min.getBlockX() && getBlockX() <= max.getBlockX()
&& getBlockY() >= min.getBlockY() && getBlockY() <= max.getBlockY()
&& getBlockZ() >= min.getBlockZ() && getBlockZ() <= max.getBlockY();
}
/**
* 2D transformation.
*