openvr watch
This commit is contained in:
@@ -304,7 +304,7 @@ where
|
||||
#[cfg(debug_assertions)]
|
||||
log::trace!("Hit: {} {:?}", hovered.state.name, hit);
|
||||
|
||||
if pointer.now.grab && !pointer.before.grab {
|
||||
if pointer.now.grab && !pointer.before.grab && hovered.state.grabbable {
|
||||
pointer.start_grab(hovered);
|
||||
return hit.dist;
|
||||
}
|
||||
@@ -346,6 +346,9 @@ impl Pointer {
|
||||
}
|
||||
|
||||
if let Some(hit) = self.ray_test(overlay.state.id, &overlay.state.transform) {
|
||||
if hit.dist.is_infinite() || hit.dist.is_nan() {
|
||||
continue;
|
||||
}
|
||||
hits.try_push(hit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ impl OverlayData<OpenVrOverlayData> {
|
||||
self.data.color = Vec4::ONE;
|
||||
|
||||
self.init(app);
|
||||
self.upload_transform(overlay);
|
||||
|
||||
if self.data.width < f32::EPSILON {
|
||||
self.data.width = 1.0;
|
||||
|
||||
@@ -43,7 +43,7 @@ impl Default for OverlayState {
|
||||
want_visible: false,
|
||||
show_hide: false,
|
||||
grabbable: false,
|
||||
dirty: false,
|
||||
dirty: true,
|
||||
relative_to: RelativeTo::None,
|
||||
spawn_scale: 1.0,
|
||||
spawn_point: Vec3A::NEG_Z,
|
||||
@@ -95,6 +95,7 @@ impl OverlayState {
|
||||
self.spawn_rotation,
|
||||
self.spawn_point.into(),
|
||||
);
|
||||
self.dirty = true;
|
||||
}
|
||||
}
|
||||
pub fn reset(&mut self, app: &mut AppState) {
|
||||
|
||||
Reference in New Issue
Block a user