From 162f63a6f46821ff9c67ba22ef1dc22b93e90e24 Mon Sep 17 00:00:00 2001 From: Fabien_HENON Date: Tue, 31 Jul 2012 19:43:01 +0200 Subject: [PATCH] Added: #1469 Base implementation of the modifiers players --HG-- branch : gsoc2012-fabien --- .../camera_animation_modifiers_players.cpp | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 code/ryzom/client/src/camera_animation_manager/camera_animation_modifiers_players.cpp diff --git a/code/ryzom/client/src/camera_animation_manager/camera_animation_modifiers_players.cpp b/code/ryzom/client/src/camera_animation_manager/camera_animation_modifiers_players.cpp new file mode 100644 index 000000000..bc66187e0 --- /dev/null +++ b/code/ryzom/client/src/camera_animation_manager/camera_animation_modifiers_players.cpp @@ -0,0 +1,82 @@ +// Ryzom - MMORPG Framework +// 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 . +// + +#include "camera_animation_manager/camera_animation_modifier_player_factory.h" +#include "game_share/position_or_entity_type.h" + +///////////////////////////////////////////////////////////////////////////// +/// This animation modifier shakes the camera. The parameter is +/// - strength +class CCameraAnimationModifierPlayerShake : public ICameraAnimationModifierPlayer +{ +protected: + float Strength; + +public: + CCameraAnimationModifierPlayerShake() + { + Strength = 0.f; + } + + /// This function is called when it's time to init the modifier from an impulse + virtual bool initModifier(NLMISC::CBitMemStream& impulse) + { + impulse.serial(const_cast(Strength)); + + return true; + } + + /// Function that plays the modifier + virtual void playModifier() + { + + } +}; +CAMERA_ANIMATION_REGISTER_MODIFIER_PLAYER(CCameraAnimationModifierPlayerShake, "camera_modifier_shake"); + +///////////////////////////////////////////////////////////////////////////// +/// This animation modifier plays a sound. The parameters are +/// - sound_name +/// - sound_position +class CCameraAnimationModifierPlayerSoundTrigger : public ICameraAnimationModifierPlayer +{ +protected: + TPositionOrEntity SoundPos; + NLMISC::CSheetId SoundId; + +public: + CCameraAnimationModifierPlayerSoundTrigger() + { + SoundId = NLMISC::CSheetId::Unknown; + } + + /// This function is called when it's time to init the modifier from an impulse + virtual bool initModifier(NLMISC::CBitMemStream& impulse) + { + impulse.serial(const_cast(SoundPos)); + impulse.serial(const_cast(SoundId)); + + return true; + } + + /// Function that plays the modifier + virtual void playModifier() + { + + } +}; +CAMERA_ANIMATION_REGISTER_MODIFIER_PLAYER(CCameraAnimationModifierPlayerSoundTrigger, "sound_trigger"); \ No newline at end of file