Re: [osg-users] FPS Motion Model
Hi Brad, Recentering the mouse on every frame or event seems like a real overkill. I'd suggest you develop a manipulator that doesn't require this. Robert. On Mon, Aug 11, 2008 at 3:51 PM, Anderegg, Bradley G [EMAIL PROTECTED] wrote: Hi, I am trying to make an FPS style motion model using OSG. Every frame I calculate the mouse translation and then reset the mouse back to the center of the screen. The problem is if I call osgViewer::View::requestWarpPointer() to re-center the mouse I seem to flood the system with input events and the end result is that I seem to get much fewer mouse movement updates. I changed my code to only re-center the mouse if the mouse moved, but even still I am only getting a mouse moved event about every third frame with continuous mouse movement. This leads to a very choppy feeling mouse any ideas? Until the upgrade to OSG 2.0 the motion model worked fine, ever since it's seemed as though we are not re-centering it properly. Is there a better way to re-center the mouse? Brad Senior Software Engineer Alion Science Technology Corporation BMH Operation - A CMMI Maturity Level 3 Organization 5365 Robin Hood Road, Suite 100 Norfolk, VA 23513 Desk: (757) 857-5670 x257 Fax: (757) 857-6781 www.alionscience.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FPS Motion Model
The problem is that through osg there is no way to get the raw mouse values. In normal mouse mode you can get the x, y and the delta values but once you move the mouse to the extent of the window we no longer get deltas even though we move the mouse. The quick and dirty solution is to recenter the mouse at 0,0 every time so that you can get the delta values. If there was a way to access the raw mouse values so that even though the extent of the window was hit and you would still get delta updates then there would not be an issue. If you have any ideas of how to build this type of motion model without having to warp the mouse pointer I would like to hear about them. Judd Robert Osfield wrote: Hi Brad, Recentering the mouse on every frame or event seems like a real overkill. I'd suggest you develop a manipulator that doesn't require this. Robert. On Mon, Aug 11, 2008 at 3:51 PM, Anderegg, Bradley G [EMAIL PROTECTED] wrote: Hi, I am trying to make an FPS style motion model using OSG. Every frame I calculate the mouse translation and then reset the mouse back to the center of the screen. The problem is if I call osgViewer::View::requestWarpPointer() to re-center the mouse I seem to flood the system with input events and the end result is that I seem to get much fewer mouse movement updates. I changed my code to only re-center the mouse if the mouse moved, but even still I am only getting a mouse moved event about every third frame with continuous mouse movement. This leads to a very choppy feeling mouse any ideas? Until the upgrade to OSG 2.0 the motion model worked fine, ever since it's seemed as though we are not re-centering it properly. Is there a better way to re-center the mouse? Brad Senior Software Engineer Alion Science Technology Corporation BMH Operation - A CMMI Maturity Level 3 Organization 5365 Robin Hood Road, Suite 100 Norfolk, VA 23513 Desk: (757) 857-5670 x257 Fax: (757) 857-6781 www.alionscience.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FPS Motion Model
Hi Judd, The OSG just adapts the windowing systems provided mouse xy values, and as such is limited to the clapping that happens due to the windowing systems. Getting the delta moyse xy isn't supported, and personaly I don't know how one would go about getting this extra info from the various window systems, I'm open to suggestsions. Robert. On Tue, Aug 12, 2008 at 8:37 PM, Judd Tracy [EMAIL PROTECTED] wrote: The problem is that through osg there is no way to get the raw mouse values. In normal mouse mode you can get the x, y and the delta values but once you move the mouse to the extent of the window we no longer get deltas even though we move the mouse. The quick and dirty solution is to recenter the mouse at 0,0 every time so that you can get the delta values. If there was a way to access the raw mouse values so that even though the extent of the window was hit and you would still get delta updates then there would not be an issue. If you have any ideas of how to build this type of motion model without having to warp the mouse pointer I would like to hear about them. Judd Robert Osfield wrote: Hi Brad, Recentering the mouse on every frame or event seems like a real overkill. I'd suggest you develop a manipulator that doesn't require this. Robert. On Mon, Aug 11, 2008 at 3:51 PM, Anderegg, Bradley G [EMAIL PROTECTED] wrote: Hi, I am trying to make an FPS style motion model using OSG. Every frame I calculate the mouse translation and then reset the mouse back to the center of the screen. The problem is if I call osgViewer::View::requestWarpPointer() to re-center the mouse I seem to flood the system with input events and the end result is that I seem to get much fewer mouse movement updates. I changed my code to only re-center the mouse if the mouse moved, but even still I am only getting a mouse moved event about every third frame with continuous mouse movement. This leads to a very choppy feeling mouse any ideas? Until the upgrade to OSG 2.0 the motion model worked fine, ever since it's seemed as though we are not re-centering it properly. Is there a better way to re-center the mouse? Brad Senior Software Engineer Alion Science Technology Corporation BMH Operation - A CMMI Maturity Level 3 Organization 5365 Robin Hood Road, Suite 100 Norfolk, VA 23513 Desk: (757) 857-5670 x257 Fax: (757) 857-6781 www.alionscience.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FPS Motion Model
Robert Osfield wrote: Hi Judd, The OSG just adapts the windowing systems provided mouse xy values, and as such is limited to the clapping that happens due to the windowing systems. Getting the delta moyse xy isn't supported, and personaly I don't know how one would go about getting this extra info from the various window systems, I'm open to suggestsions. The way we handled this is to provide wrapping of the mouse to the other side of the screen/window when the pointer gets within a few pixels of the edge. The pointer values are returned as normal (and reflect the change in position), but the delta values stay consistent (the pointer position is tracking internally and the extra movement from the warp is subtracted out). For us this provided nice, smooth delta values that we used to create an FPS motion model (among others). We just had to add a couple of extra functions to enable/disable the wrapping behavior (not everyone will want it), and we also had to implement grabbing of the pointer (restricting it to the window) for windowed applications, otherwise it was possible for the pointer to leave the window if you moved it fast enough. Unfortunately, none of this code was implemented in OSG, so I can't contribute it (and I'm not in a position where I can port it right now). Maybe the idea will work for someone, though. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org