I'm in an odd situation right now:
//point playerRect at mouse pos
std::cout << mouseX << "\n";
dx = mouseX - playerX;
dy = mouseY - playerY;
trigresult = atan2(dy,dx) * 180/PI;
playerRect.setRotation(trigresult + 90);
For some reason, whenever I comment out the "std::cout << mouseX << "\n"", the trigresult only outputs 90 or -90 degrees with cout(so playerRect is either pointing straight up or straight down). And whenever it is there/isn't commented out, it works correctly and trigresult prints out correct results. Anyone know why this is?
Thanks in advance.