feat: span tracing!!!

This commit is contained in:
Nova
2023-01-14 22:32:41 -05:00
parent 1a5edee751
commit 73f3d99877
15 changed files with 160 additions and 100 deletions

View File

@@ -13,6 +13,7 @@ use nanoid::nanoid;
use stardust_xr::{schemas::flat::Datamap, values::Transform};
use std::{convert::TryFrom, sync::Arc};
use stereokit::input::{ButtonState, Key, Ray as SkRay, StereoKitInput};
use tracing::instrument;
const SK_KEYMAP: &str = include_str!("sk.kmp");
@@ -45,6 +46,7 @@ impl MousePointer {
keyboard_sender,
}
}
#[instrument(level = "debug", name = "Update Flatscreen Pointer Ray", skip_all)]
pub fn update(&self, sk: &impl StereoKitInput) {
let mouse = sk.input_mouse();

View File

@@ -6,6 +6,7 @@ use glam::Mat4;
use stardust_xr::{schemas::flat::Datamap, values::Transform};
use std::sync::{Arc, Weak};
use stereokit::input::{ButtonState, Handed, StereoKitInput};
use tracing::instrument;
pub struct SkController {
tip: Arc<InputMethod>,
@@ -21,6 +22,7 @@ impl SkController {
handed,
}
}
#[instrument(level = "debug", name = "Update StereoKit Tip Input Method", skip_all)]
pub fn update(&mut self, sk: &impl StereoKitInput) {
let controller = sk.input_controller(self.handed);
*self.tip.enabled.lock() = controller.tracked.contains(ButtonState::Active);

View File

@@ -9,6 +9,7 @@ use stereokit::{
input::{ButtonState, Handed, Joint as SkJoint, StereoKitInput},
lifecycle::StereoKitDraw,
};
use tracing::instrument;
fn convert_joint(joint: SkJoint) -> Joint {
Joint {
@@ -37,6 +38,7 @@ impl SkHand {
handed,
}
}
#[instrument(level = "debug", name = "Update Hand Input Method", skip_all)]
pub fn update(&mut self, sk: &StereoKitDraw) {
let sk_hand = sk.input_hand(self.handed);
if let InputType::Hand(hand) = &mut *self.hand.specialization.lock() {