I have a FPS-like mouse-rotated camera. Every frame it gets the position of the cursor, and then places it back to a basic reference position (i.e. the center of the screen).
While developing it on Mac, I ran into a problem where the coordinates do not correspond with the screen coordinates.
Instead of the y-coordinates increasing as you go down the screen, they increase while going up.
Also, the 0 y-coordinate is not always on the bottom. Depending on the resolution, it is sometimes in the middle (with negative y-coordinates below it).
If it helps, the number of pixels is always correct... the direction and origin in the y-direction is just incorrect.
This happens only while in fullscreen mode. The program runs fine in a window on the Mac.
getCursorControl->getPosition() on Mac
-
- Posts: 39
- Joined: Wed Jun 10, 2009 11:28 pm
- Location: Portland, Oregon
- Contact:
-
- Posts: 39
- Joined: Wed Jun 10, 2009 11:28 pm
- Location: Portland, Oregon
- Contact:
Update - 1.5.1
Quick update... after updating to 1.5.1 it looks like the negative coordinates problem is fixed.
The coordinates still start from the bottom of the screen as opposed to the top, however.
Is this fixable? Maybe it should at least be put in the documentation for future users. (Or I guess they could figure it out also )
The coordinates still start from the bottom of the screen as opposed to the top, however.
Is this fixable? Maybe it should at least be put in the documentation for future users. (Or I guess they could figure it out also )
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Unfortunately, both the dev team and the community are still short of Mac expoerts. But mabye bitplane will find some time to look into these issues in the next weeks.
So does the 1.5.1 release compile without problems under OSX? I guess we are also in urgent need for a new binary release for Mac users.
So does the 1.5.1 release compile without problems under OSX? I guess we are also in urgent need for a new binary release for Mac users.
-
- Posts: 39
- Joined: Wed Jun 10, 2009 11:28 pm
- Location: Portland, Oregon
- Contact:
i can confirm that... however it only affects me in fullscreen on a mac. If fullscreen = false it's fine...
I made a if around it, depending on fullscreen and mac
I made a if around it, depending on fullscreen and mac
Code: Select all
if(!win && param.Fullscreen == true)
{
rotateVectorAroundAxis(forwardD, rightD, deltaC.Y);
rotateVectorAroundAxis(upD, rightD, deltaC.Y);
}
else
{
rotateVectorAroundAxis(forwardD, rightD, deltaC.Y*-1);
rotateVectorAroundAxis(upD, rightD, deltaC.Y*-1);
}
Re: getCursorControl->getPosition() on Mac
Hello, this appears to still be present in 1.7.2
Cursor Y position is inverted when full screen.
Thus, also the camera controller Y motion is inverted (e.g. try 02.Quake3Map *fullscreen* on Mac, the Y motion is opposite to on Windows and Linux).
I imagine this might also mean the GUI is unusable but I haven't tested... (certainly it renders my custom GUI unusable)
My fix would be as follows:
CIrrDeviceMacOSX::storeMouseLocation()
replace
with
and possibly also (not actually tested):
CIrrDeviceMacOSX::setMouseLocation(int x,int y)
replace
with
also maybe ScreenHeight should be used instead of DeviceHeight, but in full screen they are set to the same values anyway.
Cursor Y position is inverted when full screen.
Thus, also the camera controller Y motion is inverted (e.g. try 02.Quake3Map *fullscreen* on Mac, the Y motion is opposite to on Windows and Linux).
I imagine this might also mean the GUI is unusable but I haven't tested... (certainly it renders my custom GUI unusable)
My fix would be as follows:
CIrrDeviceMacOSX::storeMouseLocation()
replace
Code: Select all
1019 else
1020 {
1021 x = (int)p.x;
1022 y = (int)p.y;
1023 y -= (ScreenHeight - DeviceHeight);
1024 }
Code: Select all
else
{
x = (int)p.x;
y = DeviceHeight - (int)p.y;
}
CIrrDeviceMacOSX::setMouseLocation(int x,int y)
replace
Code: Select all
1043 else
1044 {
1045 p.x = (float) x;
1046 p.y = (float) y + (ScreenHeight - DeviceHeight);
1047 }
Code: Select all
else
{
p.x = (float) x;
p.y = DeviceHeight - (float)y;
}
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: getCursorControl->getPosition() on Mac
That should have been fixed in SVN/trunk, so will be part of Irrlicht 1.8. Please try this with the SVN version.