mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-10 04:42:38 +01:00
Improve animation interpolation
This commit is contained in:
parent
b444e0da04
commit
13192c8524
@ -288,9 +288,10 @@ void VehicleObject::tickPhysics(float dt)
|
||||
auto rot = it.second.body->getWorldTransform().getRotation();
|
||||
auto r2 = inv * glm::quat(rot.w(), rot.x(), rot.y(), rot.z());
|
||||
|
||||
auto ldata = skeleton->getData(it.first->getIndex()).a;
|
||||
ldata.rotation = r2;
|
||||
skeleton->setData(it.first->getIndex(), { ldata, ldata, true } );
|
||||
auto& prev = skeleton->getData(it.first->getIndex()).a;
|
||||
auto next = prev;
|
||||
next.rotation = r2;
|
||||
skeleton->setData(it.first->getIndex(), { next, prev, true } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -465,10 +465,10 @@ void GameRenderer::renderPedestrian(CharacterObject *pedestrian)
|
||||
|
||||
if(!pedestrian->model->model) return;
|
||||
|
||||
// Apply the inverse of the root transform from the current animation.
|
||||
if( pedestrian->isAnimationFixed() )
|
||||
{
|
||||
auto rtranslate = pedestrian->animator->getTimeTranslation(_renderAlpha);
|
||||
// Apply the inverse of the root transform from the current animation.
|
||||
auto rtranslate = pedestrian->skeleton->getInterpolated(1).translation;
|
||||
matrixModel = glm::translate(matrixModel, -rtranslate);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user