PDA

View Full Version : How would you implement a "sticky" cursor?



spagatoni
4th May 2009, 21:56
I am currently using OGRE inside of Qt to render a 3D scene. Inside of my scene I show the user a 3D line. What I would like to do is if the user clicks and collides with that 3D line then the cursor "sticks" to the 3D line.

My issue is that the mouseMoveEvent doesn't get called nearly fast enough to produce this effect without major jumping. I can currently press on the line and then quickly move the cursor to the other side of the screen and then it jumps back to the line in my scene. Is there a way to get the mouse move at the moment it is moved a few pixels? Or am I looking for something that is out of Qts bounds? Or am I thinking about this all wrong?

Also, I did attempt to use paintEvent to do the same thing but it appears to have the same issue as not updating nearly fast enough.

If more clarity is need please let me know and thanks for taking the time to read my issue.

Thanks!