Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - geist

Pages: [1]
1
General / [WIN7] Odd problem with std::cout
« on: January 26, 2013, 12:47:29 am »
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.

Pages: [1]