Mouse Paning in FPS Camera

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
eeheeehe
Posts: 22
Joined: Tue Sep 28, 2004 3:33 am

Mouse Paning in FPS Camera

Post by eeheeehe »

Is it possible to set the FPS camera so that it doesn't rotate unless the mouse is outside a certain range of movement.

For Example:

Code: Select all

                           Window
+-------------------------------------------------------+
|                        MouseBox                                |
|      +------------------------------------------+        |
|       |                                                     |        |
|       |                                                     |        |
|       |            * Cursor                             |        |
|       |                                                     |        |
|       |                                                     |        |
|       |                                                     |        |
|       |                                                     |        |
|       |                                                     |        |
|       |                                                     |        |
|       |                                                     |        |
|      +------------------------------------------+        |
|                                                                      |
+-------------------------------------------------------+

some psuedo code:

Code: Select all

if ( Cursor inside Mousebox )
{
      do nothing with camera;
}
else
if ( Cursor outside MouseBox )
{
      Camera -> Rotate;
}

Sorry if this is a bit hard to understand, but its kind of hard for me to explain...
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Yeah. Just create your own camera class, based mostly on the FPS camera. Shouldn't be that hard.
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Post Reply