There is absolutely no way that hiv can be transmitted in this way.
'just to be safe, I would definitely get tested'
on what grounds? Are you suggesting that despite hiv being a virus so fragile that any exposure to the outside world causes its proteins to burst, could suddenly start flying about through clothes? Perhaps a good analogy is a fish. Without water, it can't go anywhere and it soon dies. Put a fish on land and you'll never see it take a walk.
The dynamics of hiv transmission need to involve direct, unexposed contact with the blood stream or mucous membrane. So that I never have to say it again - hiv will not come looking for you, it will not jump onto you and it will not pass through underwear!
'chances are you're ok'
trust me, the question poster is definitely ok as long as his penis did not have direct contact with the vagina.
Sorry, i'm just feeling a little vexed today, but i'm a little tired of people posting things here based on speculation rather than scientific evaluation.