The idea that human thoughts are affected by body health, comfort, position, and so on is a new concept called "embodied cognition".
Embodied cognition is an ongoing research program in the field of cognitive science and is a research that shows that our body is not only connected to the mind but mind is also connected to the body means body have also influence on the mind.