Skip to content

Commit 3fe9fdb

Browse files
committed
New interaction API
1 parent b8e1cdc commit 3fe9fdb

File tree

12 files changed

+1297
-1206
lines changed

12 files changed

+1297
-1206
lines changed

crates/bevy_openxr/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ bevy_xr = { path = "../bevy_xr", version = "0.5.0" }
2323

2424
# other
2525
openxr = "0.14.0"
26+
serde = "1"

crates/bevy_openxr/src/conversion.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
use bevy_math::{Quat, Vec2, Vec3};
1+
use bevy_math::{Quat, Vec3};
22
use bevy_utils::Duration;
3-
use bevy_xr::XrTime;
43
use openxr as xr;
54

6-
pub fn to_xr_time(time: xr::Time) -> XrTime {
7-
XrTime::from_nanos(time.as_nanos() as _)
5+
use crate::OpenXrTime;
6+
7+
pub fn to_xr_time(time: xr::Time) -> OpenXrTime {
8+
OpenXrTime::from_nanos(time.as_nanos() as _)
89
}
910

10-
pub fn from_xr_time(time: XrTime) -> xr::Time {
11+
pub fn from_xr_time(time: OpenXrTime) -> xr::Time {
1112
xr::Time::from_nanos(time.as_nanos() as _)
1213
}
1314

@@ -19,10 +20,6 @@ pub fn from_duration(duration: Duration) -> xr::Duration {
1920
xr::Duration::from_nanos(duration.as_nanos() as _)
2021
}
2122

22-
pub fn to_vec2(v: xr::Vector2f) -> Vec2 {
23-
Vec2::new(v.x, v.y)
24-
}
25-
2623
pub fn to_vec3(v: xr::Vector3f) -> Vec3 {
2724
Vec3::new(v.x, v.y, v.z)
2825
}

0 commit comments

Comments
 (0)