Mouse look?

You must understand the Game Editor concepts, before post here.

Re: Mouse look?

Postby lcl » Sat Mar 23, 2013 7:25 pm

I was playing around with trying to add mouse look to my raycasting engine and I ended up trying what you have now done too.
So I tried using the previous rotating speed and it worked, kinda.. But it's still not good enough for actually playing a game. :/

I even tried to make it so that when the cursor has reached the left or right side of the view, the program would start tracking the cursors movement on y axis
and if its position changes, rotate as if the x position had changed. I tried this because I thought that when people rotate using their mouse, the mouse isn't only moved on the
x axis, but y axis too, and from that it could be possible to make the program guess if the mouse was moved. This idea also worked, but not well enough for being used in game. :P

It would be so nice to be able to add a real mouse look to my engine, but it just seems to be impossible with GE.
Of course if I knew some C++ I could write a program that tracks the cursors movements for my engine, and then sends the information to it
by a textfile. But, unfortunately, I don't know that much C++. :/
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Mouse look?

Postby bamby1983 » Sat Mar 23, 2013 8:41 pm

You're right. Unfortunately, GE only tracks the mouse position, not its actual movement, so a real mouse look doesn't seem to be readily available at the moment. If the look speed at the edges can be overlooked, then the rest can be achieved. Alternately, the xmouse and ymouse variables shouldn't be read-only so we can programatically maintain the mouse position at the center of the screen at the end of the function for each frame.
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Re: Mouse look?

Postby GEuser » Sun Mar 24, 2013 5:32 am

I'm just thinking out aloud so don't know if this is would be applicable. Could you create a transparent actor (as in a normal actor with a transpaeant image so that it remains hidden) and have it follow the mouse and use the actor to record or track movement with some clever alogrithm? Have no coding suggestion perhaps some others might be able to realise this?
GEuser
 
Posts: 204
Joined: Thu Jan 05, 2012 3:08 pm
Score: 19 Give a positive score

Re: Mouse look?

Postby bamby1983 » Sun Mar 24, 2013 2:55 pm

Thanks for the suggestion, GEUser. While what you say is certainly possible, we would still face the same issue. Eventually, the transparent actor position would depend upon the mouse position, which, when at one extreme of the screen, doesn't change relative to that direction anymore. For example, if the mouse is at the left edge of the screen, it cannot go further left, so in effect, it behaves as if it is just sitting still even if the user keeps moving his mouse towards the left.
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Previous

Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest