Yes. You are thinking of the pathetic fallacy. The term was coined by John Ruskin, and it is closely related to the device of personification. Often, when using the pathetic fallacy, authors will attribute human characteristics to setting, usually reflecting a character's emotions and personality. Ruskin originally intended the definition to describe a mistake or a lapse in language control, but it has since been adopted to mean a conscious choice in style.
The following example is from Alfred, Lord Tennyson's poem "Maud":
There has fallen a splendid tear
From the passion-flower at the gate.
She is coming, my dove, my dear;
She is coming, my life, my fate.
The red rose cries, "She is near, she is near;"
And the white rose weeps, "She is late;"
The larkspur listens, "I hear, I hear;"
And the lily whispers, "I wait."
Here, we can see the emotions of the speaker are reflected in the flowers. Other literary works that make extensive use of pathetic fallacy include Macbeth and Jane Eyre. Here is an example from Jane Eyre:
“It stood up, black and riven: the trunk, split down the center, gasped ghastly. The cloven halves were not broken from each other, for the firm base and strong roots kept them unsundered below; though community of vitality was destroyed—the sap could flow no more: their great boughs on each side were dead, and next winter’s tempests would be sure to fell one or both to earth; as yet, however they might be said to form one tree—a ruin, but an entire ruin.”
Here, the tree reflects Jane & Rochester's relationship: strong roots and base, but a brutal strike has split the two. The "sap" of their passion could no longer flow, & another blow would surely end the relationship. In this novel, that blow comes in the form of Bertha, Rochester's legal wife. Thus pathetic fallacy can be used in obvious or subtle ways, and can be an effective literary device.
It's known as pathetic fallacy. "The attribution of human emotions or characteristics to inanimate objects or to nature; for example, angry clouds; a cruel wind."
John Ruskin coined the term in 1856s Modern Painters. He gives this example:
They rowed her in across the rolling foam—
The cruel, crawling foam.
The foam is not cruel, neither does it crawl. The state of mind which attributes to it these characters of a living creature is one in which the reason is unhinged by grief. All violent feelings have the same effect. They produce in us a falseness in all our impressions of external things, which I would generally characterize as the 'Pathetic Fallacy'.
Enotes has this defintion:
a mild form of poetic personification in which human motives are attributed to inanimate nature or non-human creatures (e.g. ‘the scolding winds’, Julius Caesar 1.3.5). John Ruskin, who coined the term, commended Shakespeare for his sparing use of such metaphors, by comparison with later ‘morbid’ poets.
I also use pathetic fallacy to signify weather imagery that parallels human emotion, like in Act I of Macbeth: the storm parallels the storm inside the Macbeths. Also, in Act II of Othello: the storm parallels the rage of jealousy soon to swirl in Othello. I'm not quite sure this is accurate, but I make the connection nonetheless.