public static bool MinZ(float yaw, float pitch, float z) { if ((pitch > 90 && pitch < 270) && (z < (0 + Globals.CART_HEIGHT * -1 * Math.Cos(MathHelper.ToRadians(pitch))))) { return(false); } else if (z < 0) { return(false); } else { return(true); } }