forked from 1b-agent/opencadstudio-upstream
refactor: finish OST f64 integration; drop vestigial _f64 suffixes
- Object-snap-tracking points now project through the relative-to-eye path (view_proj_rte + eye) instead of the full view-projection, so they stay precise at UTM-scale coordinates — the last consumer of the legacy full view_proj outside the CPU frustum-cull / scissor path. - Rename Camera::project_f64 → project and unproject_on_plane_f64 → unproject_on_plane: the f32 twins are gone, so the disambiguating suffix is vestigial. eye_f64 keeps its name — the f32 eye() still builds the view matrices. - Remove stale #[allow(dead_code)] from eye_f64 / project / unproject_on_plane (all live now). Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
29415cac20
commit
5b1a5a71a0
3 files changed
+15
-13
No files matched your search
+8
-3
@@ -221,14 +221,19 @@ impl OpenCADStudio {
|
||||
None
|
||||
};
|
||||
|
||||
// OST tracking points → screen positions.
|
||||
// OST tracking points → screen positions, projected relative-to-eye
|
||||
// so they stay precise at UTM-scale coordinates (the full
|
||||
// view-projection cancels catastrophically in f32).
|
||||
let ost_points: Vec<overlay::OstTrackPoint> = if self.snapper.otrack_enabled {
|
||||
let vp_mat = tab.scene.camera.borrow().view_proj(vp_bounds);
|
||||
let (view_rot, eye) = {
|
||||
let cam = tab.scene.camera.borrow();
|
||||
(cam.view_proj_rte(vp_bounds), cam.eye_f64())
|
||||
};
|
||||
self.snapper
|
||||
.tracking_points
|
||||
.iter()
|
||||
.map(|&wp| {
|
||||
let ndc = vp_mat.project_point3(wp);
|
||||
let ndc = view_rot.project_point3((wp.as_dvec3() - eye).as_vec3());
|
||||
overlay::OstTrackPoint {
|
||||
screen: iced::Point::new(
|
||||
(ndc.x + 1.0) * 0.5 * vp_bounds.width,
|
||||
|
||||
Reference in new issue
Block a user