Skip to content

Commit

Permalink
Add convenience methods for combinedDirectionCheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Mar 8, 2013
1 parent c23482f commit 593ea71
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -139,6 +139,16 @@ public static double directionCheck(final double sourceX, final double sourceY,
return off;
}

public static double combinedDirectionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double precision, final double anglePrecision)
{
return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), targetX, targetY, targetZ, targetWidth, targetHeight, precision, anglePrecision);
}

public static double combinedDirectionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final Block target, final double precision, final double anglePrecision)
{
return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), target.getX(), target.getY(), target.getZ(), 1, 1, precision, anglePrecision);
}

/**
* Combine directionCheck with angle, in order to prevent low-distance abuse.
* @param sourceX
Expand Down

0 comments on commit 593ea71

Please sign in to comment.