Repository navigation
Commit f3422f9
committed
[Bugfix] Stop root motion from wrapping at a one-shot clip's duration
applyRootMotion computed its own channelTime via fmod(currentTime,
clipDuration), unconditionally, regardless of whether the clip's
channels repeat. Once currentTime passed a non-repeating clip's
duration, this wrapped back near zero, which wrappedChannelTime then
misread as a fresh loop and injected a full loop's root displacement
at that instant -- a visible snap right as a one-shot animation (e.g.
a kick) finished, even though ClipSampler already holds the displayed
pose correctly past that point.
Match ClipSampler: clamp to [0, duration] when no animated channel
repeats, only wrap when at least one does.1 parent b2b6706 commit f3422f9
2 files changed
Lines changed: 38 additions & 1 deletion
File tree
- Sources/UntoldEngine/Animation
- Tests/UntoldEngineTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
208 | 213 | | |
209 | 214 | | |
210 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
268 | 300 | | |
269 | 301 | | |
270 | 302 | | |
| |||
0 commit comments