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 {
13 Self {
14 virtual_position: (vx, vy, vz),
15 physical_id: id,
16 confidence: 1.0,
17 is_active: true,
18 }
19 }
20}
21
22pub struct ArDeviceState {
24 pub camera_pose: (f64, f64, f64, f64, f64, f64), pub passthrough_enabled: bool,
26 pub tracking_confidence: f64, pub anchors: Vec<PhysicalAnchor>,
28}
29
30impl ArDeviceState {
31 pub fn new() -> Self {
33 Self {
34 camera_pose: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
35 passthrough_enabled: false,
36 tracking_confidence: 0.0,
37 anchors: Vec::new(),
38 }
39 }
40
41 pub fn update_pose(&mut self, pose: (f64, f64, f64, f64, f64, f64), confidence: f64) {
43 self.camera_pose = pose;
44 self.tracking_confidence = confidence;
45 }
46
47 pub fn add_anchor(&mut self, anchor: PhysicalAnchor) {
49 self.anchors.push(anchor);
50 }
51}