コード例 #1
0
ファイル: CollisionHelper.java プロジェクト: retsrif/SpoutAPI
 /**
  * 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
ファイル: BlockFaces.java プロジェクト: somners/SpoutAPI
 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;
 }