If I cook when I'm more than a little bit hungry, I usually end up very uninterested in what I make. It's not that it doesn't taste good - my critics generally give solid reviews - I just feel like my food mindset/palate shuts off. This is especially the case when I'm cooking just for myself.
Also agree that attitude can affect the outcome. I do fine under pressure - done some of my best stuff with 15 hungry/wine-happy folks growling in the dining room - but anxiety totally kills the taste. I have a horrible time cooking for girls I really like during the courtship period ... I still manage to get laid

but then I have to prove that I really do have good moves in the kitchen.