| 184 | } |
| 185 | |
| 186 | void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool continuePlay) |
| 187 | { |
| 188 | AssertFatal(duration>=0.0f,"TSThread::transitionToSequence: negative duration not allowed"); |
| 189 | |
| 190 | // make sure these nodes are smoothly interpolated to new positions... |
| 191 | // basically, any node we controlled just prior to transition, or at any stage |
| 192 | // of the transition is interpolated. If we start to transtion from A to B, |
| 193 | // but before reaching B we transtion to C, we interpolate all nodes controlled |
| 194 | // by A, B, or C to their new position. |
| 195 | if (transitionData.inTransition) |
| 196 | { |
| 197 | transitionData.oldRotationNodes.overlap(getSequence()->rotationMatters); |
| 198 | transitionData.oldTranslationNodes.overlap(getSequence()->translationMatters); |
| 199 | transitionData.oldScaleNodes.overlap(getSequence()->scaleMatters); |
| 200 | } |
| 201 | else |
| 202 | { |
| 203 | transitionData.oldRotationNodes = getSequence()->rotationMatters; |
| 204 | transitionData.oldTranslationNodes = getSequence()->translationMatters; |
| 205 | transitionData.oldScaleNodes = getSequence()->scaleMatters; |
| 206 | } |
| 207 | |
| 208 | // set time characteristics of transition |
| 209 | transitionData.oldSequence = sequence; |
| 210 | transitionData.oldPos = mSeqPos; |
| 211 | transitionData.duration = duration; |
| 212 | transitionData.pos = 0.0f; |
| 213 | transitionData.direction = timeScale>0.0f ? 1.0f : -1.0f; |
| 214 | transitionData.targetScale = continuePlay ? 1.0f : 0.0f; |
| 215 | |
| 216 | // in transition... |
| 217 | transitionData.inTransition = true; |
| 218 | |
| 219 | // set target sequence data |
| 220 | sequence = seq; |
| 221 | priority = getSequence()->priority; |
| 222 | mSeqPos = toPos; |
| 223 | makePath = getSequence()->makePath(); |
| 224 | path.start = path.end = 0; |
| 225 | path.loop = 0; |
| 226 | |
| 227 | // 1.0f doesn't exist on cyclic sequences |
| 228 | if (mSeqPos>0.9999f && getSequence()->isCyclic()) |
| 229 | mSeqPos = 0.9999f; |
| 230 | |
| 231 | // select keyframes |
| 232 | selectKeyframes(mSeqPos,getSequence(),&keyNum1,&keyNum2,&keyPos); |
| 233 | } |
| 234 | |
| 235 | bool TSThread::isInTransition() |
| 236 | { |
no test coverage detected