Mouse look

Member
Posts: 49
Joined: 2006.07
Post: #1
My team is working on a first person game and we want the player to be able to turn 360 degrees via the mouse. The only problem is, all I know how to use for mouse input is Carbon Event Manager stuff that returns mouse coordinates... so when the cursor gets to the left or right side of the screen, the character can't turn any farther. Is there some function or event constant that would let me access the mouse more directly, e.g. tell if the mouse is being moved independent of where the system cursor ends up?
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
CG_EXTERN CGError CGAssociateMouseAndMouseCursorPosition(boolean_t connected);
from CGRemoteOperation.h in ApplicationServices.framework

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Luminary
Posts: 5,125
Joined: 2002.04
Post: #3
Ed's code will pin the mouse where it is, but that won't help on its own, since the mouse position returned from the carbon events will always be the same...

The Carbon events include a mouse delta, though, that's not clamped by the screen bounds.
Quote this message in a reply
Member
Posts: 49
Joined: 2006.07
Post: #4
Oh cool, mouse delta even saves me the trouble of caching the previous position and subtracting. Thanks.
Quote this message in a reply
Post Reply