예제 #1
0
 /**
  * Gets the collision point between two BoundingBoxes.
  *
  * @param a
  * @param b
  * @return
  */
 public static Vector3 getCollision(BoundingBox a, BoundingBox b) {
   BoundingBox intersection = getIntersection(a, b);
   if (intersection == null) {
     return null;
   }
   Vector3 ret = new Vector3(intersection.min);
   ret.add(intersection.max);
   ret.multiply(0.5f);
   return ret;
 }
예제 #2
0
 public BlockFaces(BlockFace... blockfaces) {
   this.faces = blockfaces;
   byte mask = 0;
   Vector3 offsetc = new Vector3();
   for (BlockFace face : this.faces) {
     offsetc = offsetc.add(face.getOffset());
     mask |= face.getMask();
   }
   offset = offsetc;
   this.mask = mask;
 }