Added: #1469 Implementation of the sendCameraStep function for the basic animation + changing variables that express either a position or an entity from string to a type (to change it easily if needed)

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 13 years ago
parent b99cfc1557
commit eb5769e0ef

@ -17,6 +17,8 @@
#include "camera_animation_manager/camera_animation_step_factory.h" #include "camera_animation_manager/camera_animation_step_factory.h"
typedef std::string TPositionOrEntity;
/// Basic camera animation step that has generic values /// Basic camera animation step that has generic values
/// - look_at_position /// - look_at_position
/// - text /// - text
@ -24,7 +26,7 @@
class CCameraAnimationStepBasic : public ICameraAnimationStep class CCameraAnimationStepBasic : public ICameraAnimationStep
{ {
protected: protected:
std::string LookAtPos; TPositionOrEntity LookAtPos;
std::string Text; std::string Text;
float Duration; float Duration;
@ -73,7 +75,9 @@ public:
virtual void sendAnimationStep(NLMISC::CBitMemStream& bms) virtual void sendAnimationStep(NLMISC::CBitMemStream& bms)
{ {
bms.serial(const_cast<TPositionOrEntity&>(LookAtPos));
bms.serial(const_cast<std::string&>(Text));
bms.serial(const_cast<float&>(Duration));
} }
virtual float getDuration() const virtual float getDuration() const
@ -110,7 +114,7 @@ CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepStatic, "camera_animation_stat
class CCameraAnimationStepGoTo: public CCameraAnimationStepBasic class CCameraAnimationStepGoTo: public CCameraAnimationStepBasic
{ {
protected: protected:
std::string EndPos; TPositionOrEntity EndPos;
public: public:
CCameraAnimationStepGoTo() CCameraAnimationStepGoTo()
@ -153,7 +157,7 @@ CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepGoTo, "camera_animation_go_to"
class CCameraAnimationStepFollowEntity: public CCameraAnimationStepBasic class CCameraAnimationStepFollowEntity: public CCameraAnimationStepBasic
{ {
protected: protected:
std::string EntityToFollow; TPositionOrEntity EntityToFollow;
float DistanceToEntity; float DistanceToEntity;
public: public:
@ -211,7 +215,7 @@ CAMERA_ANIMATION_REGISTR_STEP(CCameraAnimationStepFollowEntity, "camera_animatio
class CCameraAnimationStepTurnAround: public CCameraAnimationStepBasic class CCameraAnimationStepTurnAround: public CCameraAnimationStepBasic
{ {
protected: protected:
std::string PointToTurnAround; TPositionOrEntity PointToTurnAround;
float DistanceToPoint; float DistanceToPoint;
float Speed; float Speed;

Loading…
Cancel
Save