Camera Animator

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
instinct
Posts: 87
Joined: Sat May 10, 2008 3:42 pm

Post by instinct »

I believe this is a know bug in Irrlicht 1.5. I dont know if you're using the last SVN revision or Irrlicht 1.5 but i believe CuteAlien has fixed this about 1,5 month ago and committed it. I'm not 100% sure but i had a similar problem with CursorControl->setVisible().
cheshirekow
Posts: 105
Joined: Mon Jul 27, 2009 4:06 pm
Location: Cambridge, MA

Post by cheshirekow »

You're welcome, hopefully we can figure it out :)
freezzo
Posts: 27
Joined: Thu Mar 08, 2007 6:36 pm
Contact:

Post by freezzo »

In both cases, the cursor doesn't appear or hide until the mouse button is raised(released), even though im telling the opposite to happen on down(pressing).
freezzo
Posts: 27
Joined: Thu Mar 08, 2007 6:36 pm
Contact:

Post by freezzo »

also, I can't seem to figure out the "not resetting cursor location" after moving the camera.

Do you also know why the screen "snaps" when I right click?
cheshirekow
Posts: 105
Joined: Mon Jul 27, 2009 4:06 pm
Location: Cambridge, MA

Post by cheshirekow »

When I get some time I will try to compile and run your code and let you know if I can see why this isn't working. I'm compiling my codes with MinGW GCC on Windows XP with 1.5 (not the svn trunk) and not experiencing this problem.

The screen will "snap" when you stop watching the cursor and resetting the cursor to (0,0) for a while, and then you start doing it again. When that happens, the cursor will be "far" away from (0,0) so it will jump to the position the mouse is at. This may be your issue. Again, I will try to take a look at the program in more detail but it will be a little while.
freezzo
Posts: 27
Joined: Thu Mar 08, 2007 6:36 pm
Contact:

Post by freezzo »

So if i always watch the cursor, this should also help provide an easier way to move the camera based on the current location of the mouse, and not forcing it to the center before i start the rotation code. Is this a correct assumption?
cheshirekow
Posts: 105
Joined: Mon Jul 27, 2009 4:06 pm
Location: Cambridge, MA

Post by cheshirekow »

Ok, I compiled your code and looked at it for a bit, and I definitely see what you're talking about. It is a very strange and frustrating problem, but I have an idea of why it's doing this.

It's been a while since I've done any real windows work, but as I recall the windows message system places priority on input events. I think what is happening is that: since the mouse button is held down, the OS is continuously sending mouse events (messages) that supercede user messages. This doesn't make 100% sense to me but what I'm guessing is that setVisible() issues a message to the OS to stop displaying the cursor which isn't handled until after the continuous stream of mouse input is done (you release the mouse) due how windows prioritizes it's messages.

I think there are a couple of options for a work around. One is that you can hide the mouse always, and use a custom mouse cursor (display a texture) and then you and the irrlicht system get to decide when it is displayed.

You might want to start digging around the source and try to confirm my suspicions, and maybe work out a fix.
freezzo
Posts: 27
Joined: Thu Mar 08, 2007 6:36 pm
Contact:

Post by freezzo »

I think it may just be easier to go the custom cursor route, even its a duplicated windows cursor. I will have to look into that.

Thanks for the help!!!

Now I just have to figure out the actual camera part :)
Post Reply