From ed42786901fba42948481c508646acb42b62b129 Mon Sep 17 00:00:00 2001 From: Fabien_HENON Date: Sat, 9 Jun 2012 19:05:48 +0200 Subject: [PATCH] Added: #1469 Parsing of camera animation return step --HG-- branch : gsoc2012-fabien --- .../camera_animation_steps.cpp | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp index e5c0df115..de069a4f6 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp @@ -18,7 +18,6 @@ #include "camera_animation_manager/camera_animation_step_factory.h" /// Basic camera animation step that has generic values -/// - name /// - look_at_position /// - text /// - duration @@ -244,4 +243,40 @@ public: return true; } }; -CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepTurnAround, "camera_animation_turn_around"); \ No newline at end of file +CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepTurnAround, "camera_animation_turn_around"); + +///////////////////////////////////////////////////////////////////////////// +/// Animation step that returns to the starting position. It directly inherits from the interface because it +/// does not need all the parameters of a basic step +/// - duration +class CCameraAnimationStepReturn : public ICameraAnimationStep +{ +protected: + float Duration; + +public: + CCameraAnimationStepReturn() + { + Duration = 0.f; + } + + virtual bool parseStep(const NLLIGO::IPrimitive* prim, const std::string& filename) + { + std::string value; + + // We get the duration + if (!prim->getPropertyByName("duration", value)) + { + nlwarning(" impossible to get the duration property of the basic step in primitive : %s", filename.c_str()); + return false; + } + if (!NLMISC::fromString(value, Duration)) + { + nlwarning(" impossible to convert the string : %s, in float in the basic step in primitive : %s", value.c_str(), filename.c_str()); + return false; + } + + return true; + } +}; +CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepReturn, "camera_animation_return"); \ No newline at end of file