Added: #1469 Basic implementation of a CamAnimMode in the UserControls

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 12 years ago
parent 4fecf73407
commit 16daae2b6e

@ -0,0 +1,81 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//////////////
// INCLUDES //
//////////////
#include "stdpch.h"
// Client.
#include "../../input.h"
#include "../user_controls.h"
#include "../../user_entity.h"
#include "../../view.h"
#include "../../interface_v3/interface_manager.h"
#include "../../entities.h"
///////////
// USING //
///////////
////////////
// EXTERN //
////////////
///////////////
// Functions //
///////////////
//-----------------------------------------------
// camAnimModeStart :
// Manage interactions in interactive mode (start).
//-----------------------------------------------
void CUserControls::camAnimModeStart()
{
// No more Velocity.
UserEntity->frontVelocity(0);
UserEntity->lateralVelocity(0);
// No more autowalk
_DirectionMove = none;
// Third person view but player dead, user is not selectable.
UserEntity->selectable(false);
_InternalView = false;
// Show/hide all or parts of the user body (after _InternaView is set).
UserEntity->updateVisualDisplay();
}// camAnimModeStart //
//-----------------------------------------------
// camAnimModeStop :
// Manage interactions in interactive mode (stop).
//-----------------------------------------------
void CUserControls::camAnimModeStop()
{
UserEntity->frontVelocity(_CamAnimEntityFrontVelocity);
UserEntity->lateralVelocity(_CamAnimEntityLateralVelocity);
}// camAnimModeStop //
//-----------------------------------------------
// camAnimMode :
// Manage interactions in free head mode.
//-----------------------------------------------
void CUserControls::camAnimMode()
{
// Call the camera animation update function to update the view
}// camAnimMode //

@ -172,6 +172,9 @@ void CUserControls::init()
_NeedReleaseForward = false;
_NextForwardCancelMoveTo = false;
_CamAnimEntityFrontVelocity = 0.f;
_CamAnimEntityLateralVelocity = 0.f;
}// init //
@ -238,6 +241,11 @@ void CUserControls::update()
deathMode();
break;
// Camera animation mode
case CamAnimMode:
camAnimMode();
break;
// Mount Mode
case MountMode:
mountMode();
@ -1089,6 +1097,11 @@ void CUserControls::mode(const TMoveMode mode)
deathModeStop();
break;
// Camera animation Mode
case CamAnimMode:
camAnimModeStop();
break;
// Mount Mode
case MountMode:
mountModeStop();
@ -1125,6 +1138,11 @@ void CUserControls::mode(const TMoveMode mode)
deathModeStart();
break;
// Camera animation Mode
case CamAnimMode:
camAnimModeStart();
break;
// Mount Mode
case MountMode:
mountModeStart();
@ -1160,6 +1178,10 @@ string CUserControls::modeStr() const
case CUserControls::DeathMode:
return "DeathMode";
// Camera animation Mode
case CUserControls::CamAnimMode:
return "CamAnimMode";
// Mount Mode
case CUserControls::MountMode:
return "MountMode";

@ -55,6 +55,7 @@ public:
DeathMode, // Mode for the Death.
MountMode, // Mode for the Mount.
ThirdMode, // Third Person View Mode
CamAnimMode, // Mode for camera animation
nbMode // Not really a mode, just here to know how many modes are there.
};
@ -109,6 +110,13 @@ private:
/// Manage the Death Mode.
void deathMode();
/// Manage the camera animation Mode (start).
void camAnimModeStart();
/// Manage the camera animation Mode (stop).
void camAnimModeStop();
/// Manage the camera animation Mode.
void camAnimMode();
/// Manage the Mount Mode (start).
void mountModeStart();
/// Manage the Mount Mode (stop).
@ -305,6 +313,10 @@ private:
/// when true the next forward action will cancel any moveto
bool _NextForwardCancelMoveTo;
/// Variables used by the camera animation mode to remember values
float _CamAnimEntityFrontVelocity;
float _CamAnimEntityLateralVelocity;
};
/// User Controls (mouse, keyboard, interfaces, ...)

Loading…
Cancel
Save