Added: #1469 Parsing of camera animation shake modifier

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 13 years ago
parent d89477ff21
commit 3bf06cb247

@ -0,0 +1,53 @@
// 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/>.
//
#include "camera_animation_manager/camera_animation_modifier_factory.h"
/////////////////////////////////////////////////////////////////////////////
/// This animation modifier shakes the camera. The parameter is
/// - strength
class CCameraAnimationModifierShake : public ICameraAnimationModifier
{
protected:
float Strength;
public:
CCameraAnimationModifierShake()
{
Strength = 0.f;
}
virtual bool parseModifier(const NLLIGO::IPrimitive* prim, const std::string& filename)
{
std::string value;
// We get the strength
if (!prim->getPropertyByName("duration", value))
{
nlwarning("<CCameraAnimationModifierShake parseModifier> impossible to get the strength property of the basic modifier in primitive : %s", filename.c_str());
return false;
}
if (!NLMISC::fromString(value, Strength))
{
nlwarning("<CCameraAnimationModifierShake parseModifier> impossible to convert the string : %s, in float in the basic modifier in primitive : %s", value.c_str(), filename.c_str());
return false;
}
return true;
}
};
CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierShake, "camera_modifier_shake");
Loading…
Cancel
Save