mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Fix mount footstep timing and frequency
Reduced mount footsteps from 4 beats to 2 beats per animation cycle with evenly-spaced timing at 0.25 and 0.75 normalized time. The previous 4-beat pattern (0.1, 0.35, 0.6, 0.85) was too frequent and not properly synced with mount animations.
This commit is contained in:
parent
980cec00bf
commit
0b6b403848
1 changed files with 2 additions and 2 deletions
|
|
@ -1273,14 +1273,14 @@ void Renderer::update(float deltaTime) {
|
|||
mountFootstepNormInitialized = true;
|
||||
mountFootstepLastNormTime = norm;
|
||||
} else {
|
||||
// Horse gait: 4 hoofbeats per cycle
|
||||
// Mount gait: 2 hoofbeats per cycle (synced with animation)
|
||||
auto crossed = [&](float eventNorm) {
|
||||
if (mountFootstepLastNormTime <= norm) {
|
||||
return mountFootstepLastNormTime < eventNorm && eventNorm <= norm;
|
||||
}
|
||||
return mountFootstepLastNormTime < eventNorm || eventNorm <= norm;
|
||||
};
|
||||
if (crossed(0.1f) || crossed(0.35f) || crossed(0.6f) || crossed(0.85f)) {
|
||||
if (crossed(0.25f) || crossed(0.75f)) {
|
||||
footstepManager->playFootstep(resolveFootstepSurface(), true);
|
||||
}
|
||||
mountFootstepLastNormTime = norm;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue