1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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/>.
24 #include "../../misc.h"
26 #include "nel/3d/u_driver.h"
28 #include "../../input.h"
29 #include "../user_controls.h"
30 #include "../../actions_client.h"
31 #include "../../view.h"
32 #include "../../time_client.h"
33 #include "../../entities.h"
34 #include "../../interface_v3/interface_manager.h"
35 #include "../../cursor_functions.h"
36 #include "../../entities.h"
43 using namespace NLMISC
;
50 extern UDriver
*Driver
;
51 extern CEventsListener EventsListener
; // Inputs Manager
56 //-----------------------------------------------
58 // Manage interactions in interactive mode (start).
59 //-----------------------------------------------
60 void CUserControls::mountModeStart()
62 // Get the interface instace.
63 CInterfaceManager
*instance
= CInterfaceManager::getInstance();
70 // Adjust eyes height to the mount.
71 UserEntity
->eyesHeight(2.5f
);
73 UserEntity
->frontVelocity(0);
74 UserEntity
->lateralVelocity(0);
76 _DirectionMove
= none
;
78 // UserEntity->walkVelocity(((float)(instance->getDbProp("SERVER:USER:MOUNT_WALK_SPEED")->getValue32()))/1000.0f); // was: 2.8f
79 // UserEntity->runVelocity(((float)(instance->getDbProp("SERVER:USER:MOUNT_RUN_SPEED")->getValue32()))/1000.0f); // was: 12.f
81 // First person view, user is not selectable.
82 UserEntity
->selectable(false);
86 // Show/hide all or parts of the user body.
87 UserEntity
->updateVisualDisplay();
90 //-----------------------------------------------
92 // Manage interactions in interactive mode (stop).
93 //-----------------------------------------------
94 void CUserControls::mountModeStop()
96 // Restore eyes height.
97 UserEntity
->eyesHeight(ClientCfg
.EyesHeight
);
99 // \todo GUIGUI : remove this after the UBI Demo.
100 UserEntity
->walkVelocity(ClientCfg
.Walk
);
101 UserEntity
->runVelocity(ClientCfg
.Run
);
104 //-----------------------------------------------
106 // Manage interactions in mount mode.
107 //-----------------------------------------------
108 void CUserControls::mountMode()
110 // Manage common moves.
114 View
.viewPos(UserEntity
->pos() + CVector(0,0,_ZOscil
));