refactor(scene): remove the world_offset field (P7)

Delete the world_offset field from Scene and DerivedCaches and the
load-time assignment; every reader now uses a zero origin. Geometry is
absolute and the double-single relative-to-eye pipeline keeps it precise,
so the coarse origin is gone. world_offset_from_centers still derives
local_extent_max (camera/cull span) but returns no offset. The remaining
`world_offset: [f64;3]` function parameters are now always zero — dead
plumbing left for a later mechanical sweep; behaviour is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-23 22:42:33 +03:00
commit ccc933e7b0
8 changed files with 61 additions and 68 deletions

View file

@ -540,7 +540,7 @@ impl OpenCADStudio {
self.clipboard_centroid = super::helpers::entities_centroid(
&self.tabs[i].scene.wire_models_for(&handles),
);
self.clipboard_world_offset = self.tabs[i].scene.world_offset;
self.clipboard_world_offset = [0.0_f64; 3];
self.clipboard = entities;
self.clipboard_deps = super::ClipboardDeps::capture(
&self.tabs[i].scene.document,
@ -573,7 +573,7 @@ impl OpenCADStudio {
self.clipboard_centroid = super::helpers::entities_centroid(
&self.tabs[i].scene.wire_models_for(&handles),
);
self.clipboard_world_offset = self.tabs[i].scene.world_offset;
self.clipboard_world_offset = [0.0_f64; 3];
let count = entities.len();
self.clipboard = entities;
self.clipboard_deps = super::ClipboardDeps::capture(
@ -601,7 +601,7 @@ impl OpenCADStudio {
// so the ghost tracks the cursor instead of drifting by the
// offset gap. Zero within one drawing. (#135)
let src_wo = self.clipboard_world_offset;
let tgt_wo = self.tabs[i].scene.world_offset;
let tgt_wo = [0.0_f64; 3];
let centroid = self.clipboard_centroid
+ glam::Vec3::new(
(src_wo[0] - tgt_wo[0]) as f32,