Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / client / src / motion / modes / third_mode.cpp
blob47744330bf5f852b35c64ec2667790d18ff7f9f4
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //////////////
21 // Includes //
22 //////////////
23 #include "stdpch.h"
24 // 3D Interface.
25 #include "nel/3d/u_camera.h"
26 // Client.
27 #include "../../input.h"
28 #include "../user_controls.h"
29 #include "../../actions_client.h"
30 #include "../../user_entity.h"
31 #include "../../view.h"
32 #include "../../interface_v3/interface_manager.h"
33 #include "../../misc.h"
34 #include "../../entities.h"
35 #include "../../time_client.h"
38 ///////////
39 // Using //
40 ///////////
41 using namespace std;
42 using namespace NLMISC;
43 using namespace NL3D;
46 /////////////
47 // Externs //
48 /////////////
49 extern sint CompassMode;
50 extern UCamera MainCam;
51 extern CEventsListener EventsListener; // Inputs Manager
54 ////////////
55 // GLOBAL //
56 ////////////
58 ///////////////
59 // Functions //
60 ///////////////
62 //-----------------------------------------------
63 // thirdModeStart :
64 // Manage the Third Person View Mode (start).
65 //-----------------------------------------------
66 void CUserControls::thirdModeStart()
68 // Third person view, user is selectable.
69 UserEntity->selectable(true);
70 // External View
71 _InternalView = false;
73 // Initialize the camera
74 UserEntity->dir(UserEntity->front());
76 // Update the mount direction.
77 CEntityCL *mount = EntitiesMngr.entity(UserEntity->parent());
78 if(mount)
80 mount->front(UserEntity->front());
81 mount->dir(UserEntity->dir());
84 // Show/hide all or parts of the user body (after _InternaView is set).
85 UserEntity->updateVisualDisplay();
86 }// thirdModeStart //
88 //-----------------------------------------------
89 // thirdModeStop :
90 // Manage the Third Person View Mode (stop).
91 //-----------------------------------------------
92 void CUserControls::thirdModeStop()
94 }// thirdModeStop //
96 //-----------------------------------------------
97 // thirdMode :
98 // Manage the Third Person View Mode.
99 //-----------------------------------------------
100 void CUserControls::thirdMode()
102 // Manage common moves.
103 commonMove();
105 // Set the view
106 View.viewPos(UserEntity->pos());
107 commonSetView();
109 }// thirdMode //