Write out ascii-based session recording files in scientific notation instead. Also store position and rotation in higher precision (closes #3050)

This commit is contained in:
Alexander Bock
2024-06-01 16:57:01 +02:00
parent aa0255bccb
commit be5aeda195
2 changed files with 8 additions and 11 deletions
+7 -10
View File
@@ -189,17 +189,14 @@ struct CameraKeyframe {
void write(std::stringstream& out) const {
// Add camera position
out << std::fixed << std::setprecision(7) << _position.x << ' '
<< std::fixed << std::setprecision(7) << _position.y << ' '
<< std::fixed << std::setprecision(7) << _position.z << ' ';
out << std::setprecision(std::numeric_limits<double>::max_digits10);
out << _position.x << ' ' << _position.y << ' ' << _position.z << ' ';
// Add camera rotation
out << std::fixed << std::setprecision(7) << _rotation.x << ' '
<< std::fixed << std::setprecision(7) << _rotation.y << ' '
<< std::fixed << std::setprecision(7) << _rotation.z << ' '
<< std::fixed << std::setprecision(7) << _rotation.w << ' ';
out << std::fixed
<< std::setprecision(std::numeric_limits<double>::max_digits10)
<< _scale << ' ';
out << _rotation.x << ' '
<< _rotation.y << ' '
<< _rotation.z << ' '
<< _rotation.w << ' ';
out << std::scientific << _scale << ' ';
if (_followNodeRotation) {
out << "F ";
}
+1 -1
View File
@@ -155,7 +155,7 @@ bool KeyframeNavigator::updateCamera(Camera* camera, const CameraPose& prevPose,
const float nextInvScaleExp = glm::log(1.f / nextPose.scale);
const float interpolatedInvScaleExp = static_cast<float>(
prevInvScaleExp * (1.0 - t) + nextInvScaleExp * t
);
);
camera->setScaling(1.f / glm::exp(interpolatedInvScaleExp));
}