Added: #1469 Parsing of camera animation sound trigger modifier

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

@ -36,7 +36,7 @@ public:
std::string value; std::string value;
// We get the strength // We get the strength
if (!prim->getPropertyByName("duration", value)) if (!prim->getPropertyByName("strength", value))
{ {
nlwarning("<CCameraAnimationModifierShake parseModifier> impossible to get the strength property of the basic modifier in primitive : %s", filename.c_str()); nlwarning("<CCameraAnimationModifierShake parseModifier> impossible to get the strength property of the basic modifier in primitive : %s", filename.c_str());
return false; return false;
@ -51,3 +51,44 @@ public:
} }
}; };
CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierShake, "camera_modifier_shake"); CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierShake, "camera_modifier_shake");
/////////////////////////////////////////////////////////////////////////////
/// This animation modifier plays a sound. The parameters are
/// - sound_name
/// - sound_position
class CCameraAnimationModifierSoundTrigger : public ICameraAnimationModifier
{
protected:
std::string SoundName;
std::string SoundPos;
public:
CCameraAnimationModifierSoundTrigger()
{
SoundName = "";
SoundPos = "";
}
virtual bool parseModifier(const NLLIGO::IPrimitive* prim, const std::string& filename)
{
std::string value;
// We get the sound name
if (!prim->getPropertyByName("sound_name", value))
{
nlwarning("<CCameraAnimationModifierSoundTrigger parseModifier> impossible to get the sound_name property of the basic modifier in primitive : %s", filename.c_str());
return false;
}
SoundName = value;
// We get the sound position
if (!prim->getPropertyByName("sound_position", value))
{
nlwarning("<CCameraAnimationModifierSoundTrigger parseModifier> impossible to get the sound_position property of the basic modifier in primitive : %s", filename.c_str());
return false;
}
SoundPos = value;
return true;
}
};
CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierSoundTrigger, "sound_trigger");
Loading…
Cancel
Save