aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter/llmotioncontroller.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:57 -0500
committerJacek Antonelli2008-08-15 23:45:57 -0500
commit7e3007b63521c4b0c5bbad1c3964a557fc526ce2 (patch)
treeab231ed574db618873d6ebb25293cf7c0cb6d26e /linden/indra/llcharacter/llmotioncontroller.h
parentSecond Life viewer sources 1.20.10 (diff)
downloadmeta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.zip
meta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.tar.gz
meta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.tar.bz2
meta-impy-7e3007b63521c4b0c5bbad1c3964a557fc526ce2.tar.xz
Second Life viewer sources 1.20.11
Diffstat (limited to '')
-rw-r--r--linden/indra/llcharacter/llmotioncontroller.h58
1 files changed, 23 insertions, 35 deletions
diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h
index 48e184d..209f689 100644
--- a/linden/indra/llcharacter/llmotioncontroller.h
+++ b/linden/indra/llcharacter/llmotioncontroller.h
@@ -57,30 +57,6 @@ class LLCharacter;
57//----------------------------------------------------------------------------- 57//-----------------------------------------------------------------------------
58typedef LLMotion*(*LLMotionConstructor)(const LLUUID &id); 58typedef LLMotion*(*LLMotionConstructor)(const LLUUID &id);
59 59
60class LLMotionTableEntry
61{
62public:
63 LLMotionTableEntry();
64 LLMotionTableEntry(LLMotionConstructor constructor, const LLUUID& id);
65 ~LLMotionTableEntry(){};
66
67 LLMotion* create(const LLUUID& id);
68 static BOOL uuidEq(const LLUUID &uuid, const LLMotionTableEntry &id_pair)
69 {
70 if (uuid == id_pair.mID)
71 {
72 return TRUE;
73 }
74 return FALSE;
75 }
76
77 const LLUUID& getID() { return mID; }
78
79protected:
80 LLMotionConstructor mConstructor;
81 LLUUID mID;
82};
83
84class LLMotionRegistry 60class LLMotionRegistry
85{ 61{
86public: 62public:
@@ -92,7 +68,7 @@ public:
92 68
93 // adds motion classes to the registry 69 // adds motion classes to the registry
94 // returns true if successfull 70 // returns true if successfull
95 BOOL addMotion( const LLUUID& id, LLMotionConstructor create); 71 BOOL registerMotion( const LLUUID& id, LLMotionConstructor create);
96 72
97 // creates a new instance of a named motion 73 // creates a new instance of a named motion
98 // returns NULL motion is not registered 74 // returns NULL motion is not registered
@@ -103,7 +79,8 @@ public:
103 79
104 80
105protected: 81protected:
106 LLUUIDHashMap<LLMotionTableEntry, 32> mMotionTable; 82 typedef std::map<LLUUID, LLMotionConstructor> motion_map_t;
83 motion_map_t mMotionTable;
107}; 84};
108 85
109//----------------------------------------------------------------------------- 86//-----------------------------------------------------------------------------
@@ -130,7 +107,7 @@ public:
130 // registers a motion with the controller 107 // registers a motion with the controller
131 // (actually just forwards call to motion registry) 108 // (actually just forwards call to motion registry)
132 // returns true if successfull 109 // returns true if successfull
133 BOOL addMotion( const LLUUID& id, LLMotionConstructor create ); 110 BOOL registerMotion( const LLUUID& id, LLMotionConstructor create );
134 111
135 // creates a motion from the registry 112 // creates a motion from the registry
136 LLMotion *createMotion( const LLUUID &id ); 113 LLMotion *createMotion( const LLUUID &id );
@@ -151,11 +128,17 @@ public:
151 // returns true if successful 128 // returns true if successful
152 BOOL stopMotionLocally( const LLUUID &id, BOOL stop_immediate ); 129 BOOL stopMotionLocally( const LLUUID &id, BOOL stop_immediate );
153 130
131 // Move motions from loading to loaded
132 void updateLoadingMotions();
133
154 // update motions 134 // update motions
155 // invokes the update handlers for each active motion 135 // invokes the update handlers for each active motion
156 // activates sequenced motions 136 // activates sequenced motions
157 // deactivates terminated motions` 137 // deactivates terminated motions`
158 void updateMotion(); 138 void updateMotions(bool force_update = false);
139
140 // minimal update (e.g. while hidden)
141 void updateMotionsMinimal();
159 142
160 void clearBlenders() { mPoseBlender.clearBlenders(); } 143 void clearBlenders() { mPoseBlender.clearBlenders(); }
161 144
@@ -167,8 +150,8 @@ public:
167 void deactivateAllMotions(); 150 void deactivateAllMotions();
168 151
169 // pause and continue all motions 152 // pause and continue all motions
170 void pause(); 153 void pauseAllMotions();
171 void unpause(); 154 void unpauseAllMotions();
172 BOOL isPaused() { return mPaused; } 155 BOOL isPaused() { return mPaused; }
173 156
174 void setTimeStep(F32 step); 157 void setTimeStep(F32 step);
@@ -178,6 +161,8 @@ public:
178 161
179 motion_list_t& getActiveMotions() { return mActiveMotions; } 162 motion_list_t& getActiveMotions() { return mActiveMotions; }
180 163
164 void incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions);
165
181//protected: 166//protected:
182 bool isMotionActive( LLMotion *motion ); 167 bool isMotionActive( LLMotion *motion );
183 bool isMotionLoading( LLMotion *motion ); 168 bool isMotionLoading( LLMotion *motion );
@@ -187,7 +172,6 @@ protected:
187 // internal operations act on motion instances directly 172 // internal operations act on motion instances directly
188 // as there can be duplicate motions per id during blending overlap 173 // as there can be duplicate motions per id during blending overlap
189 void deleteAllMotions(); 174 void deleteAllMotions();
190 void addLoadedMotion(LLMotion *motion);
191 BOOL activateMotionInstance(LLMotion *motion, F32 time); 175 BOOL activateMotionInstance(LLMotion *motion, F32 time);
192 BOOL deactivateMotionInstance(LLMotion *motion); 176 BOOL deactivateMotionInstance(LLMotion *motion);
193 void deprecateMotionInstance(LLMotion* motion); 177 void deprecateMotionInstance(LLMotion* motion);
@@ -197,6 +181,10 @@ protected:
197 void updateAdditiveMotions(); 181 void updateAdditiveMotions();
198 void resetJointSignatures(); 182 void resetJointSignatures();
199 void updateMotionsByType(LLMotion::LLMotionBlendType motion_type); 183 void updateMotionsByType(LLMotion::LLMotionBlendType motion_type);
184 void updateIdleMotion(LLMotion* motionp);
185 void updateIdleActiveMotions();
186 void purgeExcessMotions();
187 void deactivateStoppedMotions();
200 188
201protected: 189protected:
202 F32 mTimeFactor; 190 F32 mTimeFactor;
@@ -210,20 +198,20 @@ protected:
210// Animations are instantiated and immediately put in the mAllMotions map for their entire lifetime. 198// Animations are instantiated and immediately put in the mAllMotions map for their entire lifetime.
211// If the animations depend on any asset data, the appropriate data is fetched from the data server, 199// If the animations depend on any asset data, the appropriate data is fetched from the data server,
212// and the animation is put on the mLoadingMotions list. 200// and the animation is put on the mLoadingMotions list.
213// Once an animations is loaded, it will be initialized and put on the mLoadedMotions deque. 201// Once an animations is loaded, it will be initialized and put on the mLoadedMotions list.
214// Any animation that is currently playing also sits in the mActiveMotions list. 202// Any animation that is currently playing also sits in the mActiveMotions list.
215 203
216 typedef std::map<LLUUID, LLMotion*> motion_map_t; 204 typedef std::map<LLUUID, LLMotion*> motion_map_t;
217 motion_map_t mAllMotions; 205 motion_map_t mAllMotions;
218 206
219 motion_set_t mLoadingMotions; 207 motion_set_t mLoadingMotions;
220 motion_list_t mLoadedMotions; 208 motion_set_t mLoadedMotions;
221 motion_list_t mActiveMotions; 209 motion_list_t mActiveMotions;
222 motion_set_t mDeprecatedMotions; 210 motion_set_t mDeprecatedMotions;
223 211
224 LLFrameTimer mTimer; 212 LLFrameTimer mTimer;
225 F32 mTime; 213 F32 mPrevTimerElapsed;
226 F32 mTimeOffset; 214 F32 mAnimTime;
227 F32 mLastTime; 215 F32 mLastTime;
228 BOOL mHasRunOnce; 216 BOOL mHasRunOnce;
229 BOOL mPaused; 217 BOOL mPaused;