diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-07-26 15:51:44 -0400 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-07-26 15:51:44 -0400 |
commit | 60d15f78e17a2203d73d58c3f1c2af941d599277 (patch) | |
tree | 58da32e9df5e9727e437efa90e98a0d4d2a3b0e9 /indra/newview/llwlanimator.h | |
parent | 85b316e5df41444eafe77964f1a4758ccfd40784 (diff) | |
parent | f79a058f3ce50361b732061ab30f4a1923fba445 (diff) |
merge with latest mesh-dev
Diffstat (limited to 'indra/newview/llwlanimator.h')
-rw-r--r-- | indra/newview/llwlanimator.h | 86 |
1 files changed, 77 insertions, 9 deletions
diff --git a/indra/newview/llwlanimator.h b/indra/newview/llwlanimator.h index 5677290213..5223b45343 100644 --- a/indra/newview/llwlanimator.h +++ b/indra/newview/llwlanimator.h @@ -28,28 +28,39 @@ #define LL_WL_ANIMATOR_H #include "llwlparamset.h" +#include "llwaterparamset.h" #include <string> #include <map> +struct LLWLParamKey; + class LLWLAnimator { public: + typedef enum e_time + { + TIME_LINDEN, + TIME_LOCAL, + TIME_CUSTOM + } ETime; + F64 mStartTime; F32 mDayRate; F64 mDayTime; // track to play - std::map<F32, std::string> mTimeTrack; - std::map<F32, std::string>::iterator mFirstIt, mSecondIt; - - // params to use - //std::map<std::string, LLWLParamSet> mParamList; - - bool mIsRunning; - bool mUseLindenTime; + std::map<F32, LLWLParamKey> mTimeTrack; + std::map<F32, LLWLParamKey>::iterator mFirstIt, mSecondIt; // simple constructor LLWLAnimator(); + ~LLWLAnimator() + { + delete mInterpBeginWL; + delete mInterpBeginWater; + delete mInterpEndWater; + } + // update the parameters void update(LLWLParamSet& curParams); @@ -63,9 +74,66 @@ public: void setDayTime(F64 dayTime); // set an animation track - void setTrack(std::map<F32, std::string>& track, + void setTrack(std::map<F32, LLWLParamKey>& track, F32 dayRate, F64 dayTime = 0, bool run = true); + void deactivate() + { + mIsRunning = false; + } + + void activate(ETime time) + { + mIsRunning = true; + mTimeType = time; + } + + void startInterpolation(const LLSD& targetWater); + + bool getIsRunning() + { + return mIsRunning; + } + + bool getUseCustomTime() + { + return mTimeType == TIME_CUSTOM; + } + + bool getUseLocalTime() + { + return mTimeType == TIME_LOCAL; + } + + bool getUseLindenTime() + { + return mTimeType == TIME_LINDEN; + } + + void setTimeType(ETime time) + { + mTimeType = time; + } + + ETime getTimeType() + { + return mTimeType; + } + + /// convert the present time to a digital clock time + static std::string timeToString(F32 curTime); + + /// get local time between 0 and 1 + static F64 getLocalTime(); + +private: + ETime mTimeType; + bool mIsRunning, mIsInterpolating; + LLWLParamSet *mInterpBeginWL; + LLWaterParamSet *mInterpBeginWater, *mInterpEndWater; + clock_t mInterpStartTime, mInterpEndTime; + + static F64 INTERP_TOTAL_SECONDS; }; #endif // LL_WL_ANIMATOR_H |