It sounds like everything is getting on top of you and you feel your life is careening out of control. So can I make a suggestion that a beloved former teacher, mnr. Goosen, made to me when I was 16 and my life was going haywire? Write two lists of everything that's going on in your life at the moment, one headed 'good things' and one headed 'bad things'. We'll come back to the good things later.
For the bad things, add some columns headed 'What can be done about this now?' and 'What can be done about this later?'. For each bad thing, write down what action you can take. You'll notice that just about everything has something that can be done about it. Then pick just one or two things on the list and take the necessary action, slowly crossing things off your list as you go. You'll feel much more in control, much less anxious, and much more positive if you can see that you are actually getting a handle on things rather than letting things get on top of you.
For example: a major bad thing in your life is that your wife apparently doesn't love you any more. What can be done about this now? Nothing, she's made that decision and you have very little influence over it. So the only thing you can do is to start to accept it (easier said than done, but you must start as soon as possible). What can be done about this later? You can continue being professional and cordial in all your dealings with her, so your life-long relationship can improve. So that you'll at least nod & smile at each other at your daughter's wedding. (Yes, you do have a life-long relationship with anyone with whom you share a child. Whether she likes it or not!).
Another bad thing is your lack of sufficient access to your daughter. What can be done now? Make each visitation a fun, special occasion for her so she looks forward to it. Let Mom be the evil, naggy parent who makes her do boring stuff like eat broccoli or tidy up her toys; let yourself be the fun parent she always has a fantastic time with. What can be done later? As soon as you can afford it and are in a stable situation, lawyer up again and sue for sole or joint custody of your daughter.
When you've finished that exercise, look at the good things and see what you can do to focus on them more. If there's something you enjoy, can you do more of it? If there's something you'd like to do that you aren't doing now or have stopped doing because of life events, can you add it to the list and start doing it again?