getMouseAbsY?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Karg
Gnoblar
Posts: 2
Joined: Thu Aug 05, 2004 8:30 pm
Location: Irvine, CA
Contact:

getMouseAbsY?

Post by Karg »

I'm trying to get the screen coordinates of the mouse, which I can only imagine is a simple operation, however; getMouseAbsY returns a very large number which does not appear to coorespond to any screen position. At the edges of the screen, the number continues to increase/decrease. Am I just missing something, or is there nothing to do this built into the input classes?
karg

User avatar
SuprChikn
Bugbear
Posts: 863
Joined: Tue Apr 19, 2005 6:10 am
Location: Melbourne, Aus
Contact:

Post by SuprChikn »

Yer, I had this same problem.
I was trying to use it to rotate a space ship at a speed relative to where the mouse was on the screen. Then I give it a test and find that the ship is spinning at light speed.
In the end I used the getRelX and Y functions to see how far the mouse had moved and added that to a pair of ints I defined to represent the mouse location, making sure myself that it never got above or below the limits of the screen.
I believe there are getAbsoluteX and Y mouse functions in CEGUI that behave properly, but I havent gotten around to adding CEGUI to my project yet.

Karg
Gnoblar
Posts: 2
Joined: Thu Aug 05, 2004 8:30 pm
Location: Irvine, CA
Contact:

Post by Karg »

The only fix I can see is to use CEGUI to do mouse screen position. Can it really be that hard to get the screen coordinates? It's a dead easy thing with SDL to get the mouse position, shouldn't that functionality be in the input reader class?

How are other people getting the screen position? _Someone_ must be doing it.
karg

qsilver
OGRE Community Helper
OGRE Community Helper
Posts: 198
Joined: Sat Oct 02, 2004 9:11 am
Location: San Francisco, California, USA

Post by qsilver »

The existing InputReader class is only designed to be "good enough" for simple games and demos, and there's a lot of things that it doesn't support. This is one of them :)

You can just call the native mouse cursor functions directly, or if you are feeling more ambitious, write a complete replacement. There's no requirement to use the Ogre input framework at all.

Post Reply