qualia_core_db/domains/geospatial/
ar_anchor.rs1pub struct PhysicalAnchor {
4 pub virtual_position: (f64, f64, f64), pub physical_id: String, pub confidence: f64, pub is_active: bool,
8}
9
10impl PhysicalAnchor {
11 pub fn new(vx: f64, vy: f64, vz: f64, id: String) -> Self {
12 Self {
13 virtual_position: (vx, vy, vz),
14 physical_id: id,
15 confidence: 1.0,
16 is_active: true,
17 }
18 }
19}
20
21pub struct ArDeviceState {
23 pub camera_pose: (f64, f64, f64, f64, f64, f64), pub passthrough_enabled: bool,
25 pub tracking_confidence: f64, pub anchors: Vec<PhysicalAnchor>,
27}
28
29impl ArDeviceState {
30 pub fn new() -> Self {
31 Self {
32 camera_pose: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
33 passthrough_enabled: false,
34 tracking_confidence: 0.0,
35 anchors: Vec::new(),
36 }
37 }
38
39 pub fn update_pose(&mut self, pose: (f64, f64, f64, f64, f64, f64), confidence: f64) {
40 self.camera_pose = pose;
41 self.tracking_confidence = confidence;
42 }
43
44 pub fn add_anchor(&mut self, anchor: PhysicalAnchor) {
45 self.anchors.push(anchor);
46 }
47}