Preserve precise viewer placements

Keep placement transformations in double precision through streaming, sidecar caching, and viewport recomposition so large coordinates can be cancelled before the final GPU float upload.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Dion Moult
2026-05-19 17:31:53 +10:00
parent 8b8fafa698
commit e0a504417c
10 changed files with 51 additions and 40 deletions
+4 -5
View File
@@ -283,10 +283,9 @@ void SceneLoader::applySidecarData(uint32_t mid, SidecarData data) {
}
if (!data.instances.empty() && !model.has_first_placement) {
using Mat4fCol = Eigen::Matrix<float, 4, 4, Eigen::ColMajor>;
using Mat4dCol = Eigen::Matrix<double, 4, 4, Eigen::ColMajor>;
model.first_placement =
Eigen::Map<const Mat4fCol>(data.instances[0].placement_transformation)
.cast<double>();
Eigen::Map<const Mat4dCol>(data.instances[0].placement_transformation);
model.has_first_placement = true;
}
@@ -356,9 +355,9 @@ void SceneLoader::onStreamerInstanceReady(InstanceChunk chunk) {
auto it = models_.find(loading_model_id_);
if (it != models_.end()) {
if (!it->second.has_first_placement) {
using Mat4fCol = Eigen::Matrix<float, 4, 4, Eigen::ColMajor>;
using Mat4dCol = Eigen::Matrix<double, 4, 4, Eigen::ColMajor>;
it->second.first_placement =
Eigen::Map<const Mat4fCol>(chunk.transform).cast<double>();
Eigen::Map<const Mat4dCol>(chunk.transform);
it->second.has_first_placement = true;
}
if (it->second.sidecar_builder) {