aboutsummaryrefslogtreecommitdiff
path: root/pipermail/nel/2001-April/000400.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
committerneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
commit0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch)
tree2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /pipermail/nel/2001-April/000400.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to 'pipermail/nel/2001-April/000400.html')
-rw-r--r--pipermail/nel/2001-April/000400.html325
1 files changed, 325 insertions, 0 deletions
diff --git a/pipermail/nel/2001-April/000400.html b/pipermail/nel/2001-April/000400.html
new file mode 100644
index 00000000..2121389f
--- /dev/null
+++ b/pipermail/nel/2001-April/000400.html
@@ -0,0 +1,325 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+ <HEAD>
+ <TITLE> [Nel] proposed control changes</TITLE>
+ <LINK REL="Index" HREF="index.html" >
+ <LINK REL="made" HREF="mailto:derikson%40montana.com">
+ <LINK REL="Previous" HREF="000399.html">
+ <LINK REL="Next" HREF="000401.html">
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <H1>[Nel] proposed control changes</H1>
+ <B>Dan Erikson</B>
+ <A HREF="mailto:derikson%40montana.com"
+ TITLE="[Nel] proposed control changes">derikson@montana.com</A><BR>
+ <I>Thu, 12 Apr 2001 20:49:18 -0600</I>
+ <P><UL>
+ <LI> Previous message: <A HREF="000399.html">[Nel] You guys will let us know when you're done mucking about,
+ right?</A></li>
+ <LI> Next message: <A HREF="000401.html">[Nel] proposed control changes</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#400">[ date ]</a>
+ <a href="thread.html#400">[ thread ]</a>
+ <a href="subject.html#400">[ subject ]</a>
+ <a href="author.html#400">[ author ]</a>
+ </LI>
+ </UL>
+ <HR>
+<!--beginarticle-->
+<PRE>Hi all, this is kind of long, sorry. I had some thoughts that I'd like to
+get some feedback on, and some code that you might find useful.
+
+I've put together a patch that changes the mouse control in snowballs so
+that the mouse is normally free, and you have to click on the window
+and move the mouse in order to move the view around. This is a change
+from the current behavior where the mouse is always locked by the
+application. This allows one to use other applications while the game
+is running. I've even used it to have two instances of snowball running at
+the same time, which should be useful for testing reasons. It'll also alow
+for using the mouse in the future for clicking on controls on other parts of
+the screen. The only thing I'm not sure about is how well it will work on
+windows. It looks like it'll work, but it would be nice if someone
+would test it.
+
+I used the right mouse button because the left mouse button is already
+in use
+for throwing a snowball, but I think these changes to the controls would
+work better:
+
+* Left mouse button to move the view around
+* Right mouse button to move forward
+* Space button to throw a snowball
+* Enter button to enter chat mode
+ After text is typed and enter is pressed, return from chat mode
+* Mousewheel forward to zoom in
+* Mousewheel backwards to zoom out
+* Left button turns the view left normally
+* If control+left or left_mouse+left, then strafe left
+* Right button turns the view right normally
+* If control+right or left_mouse+right, then strafe right
+
+The normal mode/chat mode allows us to use the keys for functionality rather
+than F1-F12, which is a little harder to remember than something like
+'r' for
+toggle radar. Also, there are a limited number of function buttons, so I
+think having access to all the other keys would allow good future expansion.
+
+The changes to the mouse buttons allows one to move around the world using
+only the mouse.
+
+It would also be nice to have the ability to customize these keys, but
+that's
+something for a little later.
+
+If anyone has any comments about this stuff, I'd love to hear them.
+
+Patch to use right mouse button to move the heading around:
+
+Index: move_listener.cpp
+===================================================================
+RCS file: /home/cvsroot/code/client/src/move_listener.cpp,v
+retrieving revision 1.23
+diff -c -r1.23 move_listener.cpp
+*** move_listener.cpp 2001/04/10 10:20:48 1.23
+--- move_listener.cpp 2001/04/13 02:21:30
+***************
+*** 54,63 ****
+ \****************************************************************/
+ CMoveListener::CMoveListener()
+ {
+! _MouseFree = false;
+
+- _CursorInit = false;
+-
+ _Width = 0;
+ _Height = 0;
+
+--- 54,61 ----
+ \****************************************************************/
+ CMoveListener::CMoveListener()
+ {
+! _MouseFree = true;
+
+ _Width = 0;
+ _Height = 0;
+
+***************
+*** 184,190 ****
+ \****************************************************************/
+ void CMoveListener::operator()(const CEvent&amp; event)
+ {
+! static const float eps = 0.001f;
+
+ // Rotation
+ if (event==EventMouseMoveId)
+--- 182,188 ----
+ \****************************************************************/
+ void CMoveListener::operator()(const CEvent&amp; event)
+ {
+! static const float eps = 0.002f;
+
+ // Rotation
+ if (event==EventMouseMoveId)
+***************
+*** 196,240 ****
+
+ if(!_MouseFree)
+ {
+! if(_CursorInit)
+ {
+! float difx = 0.5f-mouseEvent-&gt;X;
+! float dify = -(0.5f-mouseEvent-&gt;Y);
+! if( (float)fabs(difx) &gt; eps || (float)fabs(dify) &gt; eps)
+ {
+! if ( (float)fabs(difx) &gt; eps)
+! {
+! LocalArea-&gt;User.yaw( _RotSpeed*(difx) );
+ }
+! if ( (float)fabs(dify) &gt; eps)
+! {
+! LocalArea-&gt;User.ViewPitch += _RotSpeed*(dify);
+! if(LocalArea-&gt;User.ViewPitch&gt;(float)Pi/2)
+! {
+! LocalArea-&gt;User.ViewPitch = (float)Pi/2;
+! }
+! if(LocalArea-&gt;User.ViewPitch&lt;-(float)Pi/2)
+! {
+! LocalArea-&gt;User.ViewPitch = -(float)Pi/2;
+! }
+ }
+- _Scene-&gt;getDriver()-&gt;setMousePos(0.5,0.5);
+ }
+ }
+- else
+- {
+- _CursorInit = true;
+- _Scene-&gt;getDriver()-&gt;setMousePos(0.5,0.5);
+- }
+ }
+ }
+
+
+
+- // Shoot with left mouse button
+ if ( event==EventMouseDownId)
+ {
+ CEventMouse* mouseEvent=(CEventMouse*)&amp;event;
+ if(mouseEvent-&gt;Button==leftButton &amp;&amp; CanShot)
+ {
+ if ( (ClientSocket!=NULL) &amp;&amp; ClientSocket-&gt;connected() )
+--- 194,230 ----
+
+ if(!_MouseFree)
+ {
+! float difx = _MouseLockX-mouseEvent-&gt;X;
+! float dify = -(_MouseLockY-mouseEvent-&gt;Y);
+! if( (float)fabs(difx) &gt; eps || (float)fabs(dify) &gt; eps)
+ {
+! if ( (float)fabs(difx) &gt; eps)
+! {
+! LocalArea-&gt;User.yaw( _RotSpeed*(difx) );
+! }
+! if ( (float)fabs(dify) &gt; eps)
+ {
+! LocalArea-&gt;User.ViewPitch += _RotSpeed*(dify);
+! if(LocalArea-&gt;User.ViewPitch&gt;(float)Pi/2)
+! {
+! LocalArea-&gt;User.ViewPitch = (float)Pi/2;
+ }
+! if(LocalArea-&gt;User.ViewPitch&lt;-(float)Pi/2)
+! {
+! LocalArea-&gt;User.ViewPitch = -(float)Pi/2;
+ }
+ }
++ _Scene-&gt;getDriver()-&gt;setMousePos(_MouseLockX,_MouseLockY);
+ }
+ }
+ }
+
+
+
+ if ( event==EventMouseDownId)
+ {
+ CEventMouse* mouseEvent=(CEventMouse*)&amp;event;
++ // Shoot with left mouse button
+ if(mouseEvent-&gt;Button==leftButton &amp;&amp; CanShot)
+ {
+ if ( (ClientSocket!=NULL) &amp;&amp; ClientSocket-&gt;connected() )
+***************
+*** 249,254 ****
+--- 239,259 ----
+ }
+ }
+ }
++ if(mouseEvent-&gt;Button==rightButton &amp;&amp; _MouseFree)
++ {
++ _MouseLockX = mouseEvent-&gt;X;
++ _MouseLockY = mouseEvent-&gt;Y;
++ changeControlMode();
++ }
++ }
++
++ if(event==EventMouseUpId)
++ {
++ CEventMouse* mouseEvent=(CEventMouse*)&amp;event;
++ if(mouseEvent-&gt;Button==rightButton &amp;&amp; !_MouseFree)
++ {
++ changeControlMode();
++ }
+ }
+ }
+
+***************
+*** 260,265 ****
+--- 265,271 ----
+ {
+ server.addListener (EventMouseMoveId, this);
+ server.addListener (EventMouseDownId, this);
++ server.addListener (EventMouseUpId, this);
+ }
+
+
+***************
+*** 270,274 ****
+--- 276,281 ----
+ {
+ server.removeListener (EventMouseMoveId, this);
+ server.removeListener (EventMouseDownId, this);
++ server.removeListener (EventMouseUpId, this);
+ }
+
+Index: move_listener.h
+===================================================================
+RCS file: /home/cvsroot/code/client/src/move_listener.h,v
+retrieving revision 1.15
+diff -c -r1.15 move_listener.h
+*** move_listener.h 2001/03/05 09:39:44 1.15
+--- move_listener.h 2001/04/13 02:21:30
+***************
+*** 119,127 ****
+ /// Internal use
+ virtual void operator()(const NLMISC::CEvent&amp; event);
+
+- /// true if first setMousePos done
+- bool _CursorInit;
+-
+ CScene * _Scene;
+
+ /// screen width
+--- 119,124 ----
+***************
+*** 155,160 ****
+--- 152,160 ----
+ float _MouseY;
+
+ bool _Shot;
++
++ float _MouseLockX;
++ float _MouseLockY;
+ };
+
+
+Index: client.cpp
+===================================================================
+RCS file: /home/cvsroot/code/client/src/client.cpp,v
+retrieving revision 1.177
+diff -c -r1.177 client.cpp
+*** client.cpp 2001/04/12 17:06:42 1.177
+--- client.cpp 2001/04/13 02:22:13
+***************
+*** 1880,1893 ****
+ LocalArea-&gt;setEntityMovedCallback( moveEntityInstance );
+ LocalArea-&gt;setEntityRemovedCallback( deleteEntityInstance );
+
+- // hide mouse cursor
+- CNELU::Driver-&gt;showCursor(false);
+- #ifdef NL_RELEASE
+- CNELU::Driver-&gt;setCapture(true);
+- #endif
+-
+-
+-
+ // Load meshes
+ /*
+ vector&lt;string&gt;::iterator itshp;
+--- 1880,1885 ----
+
+
+</pre>
+
+
+<!--endarticle-->
+ <HR>
+ <P><UL>
+ <!--threads-->
+ <LI> Previous message: <A HREF="000399.html">[Nel] You guys will let us know when you're done mucking about,
+ right?</A></li>
+ <LI> Next message: <A HREF="000401.html">[Nel] proposed control changes</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#400">[ date ]</a>
+ <a href="thread.html#400">[ thread ]</a>
+ <a href="subject.html#400">[ subject ]</a>
+ <a href="author.html#400">[ author ]</a>
+ </LI>
+ </UL>
+</body></html>