Skip to main content

sim_lib_view_spatial/
lib.rs

1//! Spatial glasses surface encoding for SIM Web.
2//!
3//! This crate adds `surface:spatial`, a [`sim_lib_view::SurfaceCodec`] that
4//! keeps content-rate packets independent of device tracking samples. It renders
5//! values through the universal Scene view, then selects one of the glasses
6//! class routes supplied by [`sim_lib_view_device`]: pose-free spatial panels for
7//! stereo 6DoF displays, the shared one-card glance reducer for mono HUDs, or a
8//! reduced mirrored Scene for display-only glasses.
9
10#![forbid(unsafe_code)]
11#![deny(missing_docs)]
12
13pub mod co_use;
14pub mod consent;
15pub mod encode;
16pub mod glance_map;
17pub mod halo_glance;
18pub mod layout;
19pub mod pose_view;
20pub mod predict;
21pub mod rank;
22pub mod reproject;
23pub mod reproject_loop;
24pub mod voice_site;
25pub mod world;
26
27pub use co_use::{
28    GlassesCoUsePlan, GlassesCoUseRole, GlassesPeer, GlassesPeerConfig, glasses_peer_config,
29};
30pub use consent::{
31    CAP_GLASSES_CAMERA, CAP_GLASSES_HAND, CAP_GLASSES_MIC, CAP_GLASSES_POSE,
32    CAP_GLASSES_VENDOR_REPORT, CAP_GLASSES_WORLD_ANCHOR, GlassesCapability,
33    active_glasses_consent_badge_cluster, glasses_camera_grant, glasses_capability_for_expr,
34    glasses_hand_grant, glasses_mic_capability, glasses_mic_grant, glasses_pose_grant,
35    glasses_vendor_report_grant, glasses_world_anchor_grant, halo_consent_glyph,
36    require_glasses_consent, require_glasses_expr_consent, store_glasses_sample,
37    sweep_glasses_privacy,
38};
39pub use encode::{SPATIAL_SURFACE_CODEC_ID, SpatialSurfaceCodec, surface_spatial_codec_symbol};
40pub use glance_map::halo_glance_scene;
41pub use halo_glance::{HALO_ACK_MS, halo_glance_budget, halo_glance_config};
42pub use layout::{
43    GlancePreference, PanelLayout, PanelPlacement, SpatialLayout, WORKSPACE_LAYOUT_KIND,
44    WORKSPACE_LAYOUT_NAMESPACE, WORKSPACE_LAYOUT_TABLE_NAMESPACE, WorkspaceLayout,
45    arrange_spatial_panels, layout_load_op, layout_save_op, layout_table_key,
46};
47pub use pose_view::PoseView;
48pub use predict::{ClampedReprojector, clamp_predicted};
49pub use rank::{AttentionBudget, rank_for_profile, rank_glasses, rank_spatial};
50pub use reproject::Reprojector;
51pub use reproject_loop::{HaloGlanceLoop, VitureReprojectLoop, halo_loop, viture_loop};
52pub use voice_site::{
53    AsrSite, AsrSitePlacement, XR_MIC_CHUNK_KIND, XR_MIC_CHUNK_NAMESPACE, XrMicChunkRef,
54    voice_intent_via_site,
55};
56pub use world::{
57    AnchorResolution, VioTrackingStatus, WORLD_ANCHOR_REASON_NAMESPACE, WorldAnchorObservation,
58    WorldAnchorResolver, XR_TRACKING_STATUS_NAMESPACE, resolve_world_anchor,
59};
60
61/// Embedded cookbook recipe books shipped with this library.
62pub static RECIPES: sim_cookbook::EmbeddedDir =
63    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
64
65#[cfg(test)]
66mod adapter_tests;
67#[cfg(test)]
68mod consent_tests;
69#[cfg(test)]
70mod layout_tests;
71#[cfg(test)]
72mod rank_tests;
73#[cfg(test)]
74mod tests;
75#[cfg(test)]
76mod timing_tests;
77#[cfg(test)]
78mod voice_site_tests;
79#[cfg(test)]
80mod world_tests;