mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 03:12:36 +01:00
Remove forward movement from Character Animation
This commit is contained in:
parent
ec5f1d7b55
commit
a6396ec6e8
@ -219,7 +219,7 @@ glm::vec3 CharacterObject::updateMovementAnimation(float dt) {
|
||||
}
|
||||
|
||||
// If we have to, interrogate the movement animation
|
||||
const auto& modelroot = getModel()->getFrame();
|
||||
const auto& modelroot = getClump()->getFrame();
|
||||
if (movementAnimation != animations.idle &&
|
||||
!modelroot->getChildren().empty()) {
|
||||
const auto& root = modelroot->getChildren()[0];
|
||||
@ -250,6 +250,11 @@ glm::vec3 CharacterObject::updateMovementAnimation(float dt) {
|
||||
rootBone->getInterpolatedKeyframe(animTime + step).position;
|
||||
glm::vec3 d = (b - a);
|
||||
animTranslate.y += d.y;
|
||||
|
||||
// Kludge: Drop y component of root bone
|
||||
auto t = glm::vec3(root->getTransform()[3]);
|
||||
t.y = 0.f;
|
||||
root->setTranslation(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user