diff options
Diffstat (limited to 'linden/indra/llcharacter/llmotion.cpp')
-rw-r--r-- | linden/indra/llcharacter/llmotion.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/linden/indra/llcharacter/llmotion.cpp b/linden/indra/llcharacter/llmotion.cpp index f7b8f1f..54fcaa5 100644 --- a/linden/indra/llcharacter/llmotion.cpp +++ b/linden/indra/llcharacter/llmotion.cpp | |||
@@ -127,6 +127,13 @@ void LLMotion::setDeactivateCallback( void (*cb)(void *), void* userdata ) | |||
127 | mDeactivateCallbackUserData = userdata; | 127 | mDeactivateCallbackUserData = userdata; |
128 | } | 128 | } |
129 | 129 | ||
130 | //virtual | ||
131 | void LLMotion::setStopTime(F32 time) | ||
132 | { | ||
133 | mStopTimestamp = time; | ||
134 | mStopped = TRUE; | ||
135 | } | ||
136 | |||
130 | BOOL LLMotion::isBlending() | 137 | BOOL LLMotion::isBlending() |
131 | { | 138 | { |
132 | return mPose.getWeight() < 1.f; | 139 | return mPose.getWeight() < 1.f; |
@@ -135,8 +142,9 @@ BOOL LLMotion::isBlending() | |||
135 | //----------------------------------------------------------------------------- | 142 | //----------------------------------------------------------------------------- |
136 | // activate() | 143 | // activate() |
137 | //----------------------------------------------------------------------------- | 144 | //----------------------------------------------------------------------------- |
138 | void LLMotion::activate() | 145 | void LLMotion::activate(F32 time) |
139 | { | 146 | { |
147 | mActivationTimestamp = time; | ||
140 | mStopped = FALSE; | 148 | mStopped = FALSE; |
141 | mActive = TRUE; | 149 | mActive = TRUE; |
142 | onActivate(); | 150 | onActivate(); |
@@ -150,7 +158,12 @@ void LLMotion::deactivate() | |||
150 | mActive = FALSE; | 158 | mActive = FALSE; |
151 | mPose.setWeight(0.f); | 159 | mPose.setWeight(0.f); |
152 | 160 | ||
153 | if (mDeactivateCallback) (*mDeactivateCallback)(mDeactivateCallbackUserData); | 161 | if (mDeactivateCallback) |
162 | { | ||
163 | (*mDeactivateCallback)(mDeactivateCallbackUserData); | ||
164 | mDeactivateCallback = NULL; // only call callback once | ||
165 | mDeactivateCallbackUserData = NULL; | ||
166 | } | ||
154 | 167 | ||
155 | onDeactivate(); | 168 | onDeactivate(); |
156 | } | 169 | } |