-
-
-
+
+
+
+
+
+
diff --git a/dash-frontend/assets/lang/de.json b/dash-frontend/assets/lang/de.json
index 940bb372..a775153d 100644
--- a/dash-frontend/assets/lang/de.json
+++ b/dash-frontend/assets/lang/de.json
@@ -380,5 +380,6 @@
"SUSPEND_ARE_YOU_SURE": "Bist du sicher, dass du den Computer in den Ruhezustand versetzen willst?"
},
"YES": "Ja",
- "NO": "Nein"
+ "NO": "Nein",
+ "RESET_SPACE_DRAG": "Playspace-Drag zurücksetzen"
}
\ No newline at end of file
diff --git a/dash-frontend/assets/lang/en.csv b/dash-frontend/assets/lang/en.csv
index 9687dcc8..95d92ff7 100644
--- a/dash-frontend/assets/lang/en.csv
+++ b/dash-frontend/assets/lang/en.csv
@@ -348,6 +348,7 @@ PROCESS.FORCE_KILL,Force-kill,Tooltip on the kill button in the running games li
PROCESS.STOP,Stop,Tooltip on the stop button in the running games list.
PROCESS_LIST,Process list,Tab name and group box title in the Monado runtime process list section.
REFRESH,Refresh,Tooltip on the refresh button in the running games list.
+RESET_SPACE_DRAG,Reset playspace drag,"Button which resets the user's playspace origin. ""Playspace"" was previously translated as ""${DEFINITIONS.PLAYSPACE}""."
REMOVE,Remove,Button label in the skymap already downloaded dialog and Whisper cleanup dialog to remove files.
APPLY,Apply,Button label in the skymap already downloaded dialog to apply the selected skymap.
RELOAD_FROM_DISK,Reload from disk,Tooltip on the reload button in the skymap list view.
diff --git a/dash-frontend/assets/lang/en.json b/dash-frontend/assets/lang/en.json
index 4f9cdded..17e93382 100644
--- a/dash-frontend/assets/lang/en.json
+++ b/dash-frontend/assets/lang/en.json
@@ -362,6 +362,7 @@
},
"PROCESS_LIST": "Process list",
"REFRESH": "Refresh",
+ "RESET_SPACE_DRAG": "Reset playspace drag",
"REMOVE": "Remove",
"APPLY": "Apply",
"RELOAD_FROM_DISK": "Reload from disk",
diff --git a/dash-frontend/assets/lang/es.json b/dash-frontend/assets/lang/es.json
index 16292946..bce2d38c 100644
--- a/dash-frontend/assets/lang/es.json
+++ b/dash-frontend/assets/lang/es.json
@@ -380,5 +380,6 @@
"SUSPEND_ARE_YOU_SURE": "¿Estás seguro de que quieres suspender el equipo?"
},
"YES": "Sí",
- "NO": "No"
+ "NO": "No",
+ "RESET_SPACE_DRAG": "Restablecer arrastre del espacio de juego"
}
\ No newline at end of file
diff --git a/dash-frontend/assets/lang/it.json b/dash-frontend/assets/lang/it.json
index c07842fe..1938e93b 100644
--- a/dash-frontend/assets/lang/it.json
+++ b/dash-frontend/assets/lang/it.json
@@ -380,5 +380,6 @@
"SUSPEND_ARE_YOU_SURE": "Sei sicuro di voler mettere il computer in sospensione?"
},
"YES": "Sì",
- "NO": "No"
+ "NO": "No",
+ "RESET_SPACE_DRAG": "Reset trascinamento playspace"
}
\ No newline at end of file
diff --git a/dash-frontend/assets/lang/ja.json b/dash-frontend/assets/lang/ja.json
index 28a58312..325cf98f 100644
--- a/dash-frontend/assets/lang/ja.json
+++ b/dash-frontend/assets/lang/ja.json
@@ -380,5 +380,6 @@
"SUSPEND_ARE_YOU_SURE": "コンピューターをスリープ状態にしますか?"
},
"YES": "はい",
- "NO": "いいえ"
+ "NO": "いいえ",
+ "RESET_SPACE_DRAG": "プレイスペースのドラッグをリセット"
}
\ No newline at end of file
diff --git a/dash-frontend/assets/lang/pl.json b/dash-frontend/assets/lang/pl.json
index 01f40648..31e5afc2 100644
--- a/dash-frontend/assets/lang/pl.json
+++ b/dash-frontend/assets/lang/pl.json
@@ -380,5 +380,6 @@
"SUSPEND_ARE_YOU_SURE": "Czy na pewno chcesz uśpić komputer?"
},
"YES": "Tak",
- "NO": "Nie"
+ "NO": "Nie",
+ "RESET_SPACE_DRAG": "Resetuj przesunięcie przestrzeni gry"
}
\ No newline at end of file
diff --git a/dash-frontend/assets/lang/sv.json b/dash-frontend/assets/lang/sv.json
index 91331a3d..70e3507a 100644
--- a/dash-frontend/assets/lang/sv.json
+++ b/dash-frontend/assets/lang/sv.json
@@ -380,5 +380,6 @@
"INSTALLED": "Installerad",
"NOT_INSTALLED": "Ej installerad",
"YES": "Ja",
- "NO": "Nej"
+ "NO": "Nej",
+ "RESET_SPACE_DRAG": "Återställ playspace-drag"
}
\ No newline at end of file
diff --git a/dash-frontend/assets/lang/zh_CN.json b/dash-frontend/assets/lang/zh_CN.json
index ae1105a9..1e1340bb 100644
--- a/dash-frontend/assets/lang/zh_CN.json
+++ b/dash-frontend/assets/lang/zh_CN.json
@@ -380,5 +380,6 @@
"SUSPEND_ARE_YOU_SURE": "确定要让计算机进入睡眠状态吗?"
},
"YES": "确定",
- "NO": "否"
+ "NO": "否",
+ "RESET_SPACE_DRAG": "重置活动空间拖拽"
}
\ No newline at end of file
diff --git a/dash-frontend/src/frontend.rs b/dash-frontend/src/frontend.rs
index d51d80ab..e4f97e64 100644
--- a/dash-frontend/src/frontend.rs
+++ b/dash-frontend/src/frontend.rs
@@ -125,6 +125,7 @@ pub enum FrontendTask {
ShowPowerSettings(WidgetID /* source widget */),
UpdateAudioSettingsView,
RecenterPlayspace,
+ ResetSpaceDrag,
PushToast(Translation),
PlaySound(SoundType),
OpenURL(Rc
),
@@ -441,6 +442,7 @@ impl Frontend {
FrontendTask::ShowPowerSettings(pos) => self.action_show_power_settings(pos)?,
FrontendTask::UpdateAudioSettingsView => self.action_update_audio_settings()?,
FrontendTask::RecenterPlayspace => self.action_recenter_playspace(params.data)?,
+ FrontendTask::ResetSpaceDrag => self.action_reset_space_drag(params.data)?,
FrontendTask::PushToast(content) => self.toast_manager.push(content),
FrontendTask::PlaySound(sound_type) => self.queue_play_sound(sound_type),
FrontendTask::HideDashboard => self.action_hide_dashboard(params.data),
@@ -583,6 +585,12 @@ impl Frontend {
&self.state.fetch_component_as::("btn_recenter")?,
FrontendTask::RecenterPlayspace,
);
+ self.tasks.handle_button(
+ &self
+ .state
+ .fetch_component_as::("btn_reset_space_drag")?,
+ FrontendTask::ResetSpaceDrag,
+ );
Ok(())
}
@@ -644,6 +652,11 @@ impl Frontend {
Ok(())
}
+ fn action_reset_space_drag(&mut self, data: &mut T) -> anyhow::Result<()> {
+ self.interface.playspace_task(data, DashPlayspaceTask::Reset)?;
+ Ok(())
+ }
+
fn action_hide_dashboard(&mut self, data: &mut T) {
self.interface.toggle_dashboard(data);
}
diff --git a/scripts/translator/run.sh b/scripts/translator/run.sh
index 9f8ba7f0..53e88d67 100755
--- a/scripts/translator/run.sh
+++ b/scripts/translator/run.sh
@@ -33,7 +33,7 @@
#
# Base language: English (en.json)
#
-# This tool expects llama.cpp server being present (llama-server) at port 8080.
+# This tool expects llama.cpp server being present (llama-server) at port 9931.
#
# Currently we're using Gemma 4 for machine translations.
# Model URL:
@@ -51,7 +51,7 @@ if [ -z "${MODEL}" ]; then
fi
if [ -z "${LLAMA_BASE_URL}" ]; then
- export LLAMA_BASE_URL="http://127.0.0.1:8080"
+ export LLAMA_BASE_URL="http://127.0.0.1:9931"
fi
TEMPLATE="en" bun main.ts
diff --git a/wayvr/src/backend/openxr/playspace.rs b/wayvr/src/backend/openxr/playspace.rs
index 94aea445..eea60027 100644
--- a/wayvr/src/backend/openxr/playspace.rs
+++ b/wayvr/src/backend/openxr/playspace.rs
@@ -188,7 +188,7 @@ impl PlayspaceMover {
self.gravity.mark_end_drag(
&app.session.config,
relative_pos,
- data.pose.translation,
+ data.pose.matrix3,
app.delta_time,
);
@@ -283,6 +283,7 @@ impl PlayspaceMover {
config,
floor_height: config.space_gravity_floor_height,
current_space_pos: pose.translation,
+ current_playspace_rot: pose.matrix3,
})?;
Some(SpaceGravityStepResult {
diff --git a/wayvr/src/backend/playspace_common.rs b/wayvr/src/backend/playspace_common.rs
index 51d6ffdb..0d2f3892 100644
--- a/wayvr/src/backend/playspace_common.rs
+++ b/wayvr/src/backend/playspace_common.rs
@@ -1,4 +1,4 @@
-use glam::{Affine3A, Vec3A};
+use glam::{Affine3A, Mat3A, Vec3A};
use wlx_common::config::GeneralConfig;
use crate::windowing::manager::OverlayWindowManager;
@@ -11,11 +11,12 @@ pub struct SpaceGravityUpdateParams<'a> {
// current playspace offset
pub current_space_pos: Vec3A,
+
+ pub current_playspace_rot: Mat3A,
}
pub struct SpaceGravity {
- velocity: Vec3A,
- space_pos: Vec3A,
+ velocity: Vec3A, // local space
}
pub fn shift_world(
@@ -37,14 +38,13 @@ pub fn shift_world(
}
pub struct SpaceGravityUpdateResult {
- pub playspace_pos_offset: Vec3A, // position difference compared to previous update() call
+ pub playspace_pos_offset: Vec3A, // position difference compared to the previous update() call
}
impl SpaceGravity {
pub fn new() -> Self {
Self {
velocity: Vec3A::default(),
- space_pos: Vec3A::default(),
}
}
@@ -52,20 +52,19 @@ impl SpaceGravity {
&mut self,
config: &GeneralConfig,
hand_pos_diff: Vec3A,
- space_pos: Vec3A,
+ space_rot: Mat3A,
dt: f32,
) {
if config.space_gravity_enabled {
- self.velocity = hand_pos_diff * config.space_gravity_fling_strength / dt;
- self.space_pos = space_pos;
+ self.velocity =
+ space_rot.inverse() * hand_pos_diff * config.space_gravity_fling_strength / dt;
} else {
self.reset();
}
}
pub fn reset(&mut self) {
- self.velocity = Vec3A::default();
- self.space_pos = Vec3A::default();
+ self.velocity = Default::default();
}
pub fn update(&mut self, par: SpaceGravityUpdateParams) -> Option {
@@ -73,32 +72,29 @@ impl SpaceGravity {
return None;
}
- self.space_pos = par.current_space_pos;
+ let mut velocity = self.velocity;
+ velocity += Vec3A::new(0.0, par.config.space_gravity_gravity * par.dt, 0.0) /* downwards gravity */;
+ velocity *= par.config.space_gravity_damping.powf(par.dt * 10.0) /* damping */;
- let prev_pos = self.space_pos;
+ // local space
+ let prev_pos = par.current_playspace_rot.inverse() * par.current_space_pos;
+ let mut space_pos = prev_pos;
+ space_pos += velocity * par.dt;
+ space_pos.y = space_pos.y.min(par.floor_height);
- self.velocity.y += par.config.space_gravity_gravity * par.dt;
-
- // terminal velocity
- self.velocity.y = self.velocity.y.min(200.0);
-
- self.velocity *= (par.config.space_gravity_damping).powf(par.dt * 10.0);
-
- self.space_pos += self.velocity * par.dt;
-
- self.space_pos.y = self.space_pos.y.min(par.floor_height);
-
- if self.space_pos.y >= par.floor_height
- /* at floor height or below */
- {
+ // at floor height or below
+ if space_pos.y >= par.floor_height {
// apply ground friction
- self.velocity *= 1.0 - par.config.space_gravity_ground_friction * par.dt * 10.0;
+ velocity *= 1.0 - par.config.space_gravity_ground_friction * par.dt * 10.0;
}
- if self.velocity.length_squared() > 0.00003 {
+ self.velocity = velocity;
+
+ let pos_diff = space_pos - prev_pos;
+ if velocity.length_squared() > 0.00003 {
// Space position changed
return Some(SpaceGravityUpdateResult {
- playspace_pos_offset: self.space_pos - prev_pos,
+ playspace_pos_offset: par.current_playspace_rot * pos_diff,
});
}
diff --git a/wgui/src/parser/mod.rs b/wgui/src/parser/mod.rs
index 812168e3..0b9be6db 100644
--- a/wgui/src/parser/mod.rs
+++ b/wgui/src/parser/mod.rs
@@ -123,10 +123,10 @@ pub trait Fetchable {
/// Fetch a component by widget ID (returns Component)
fn fetch_component_by_widget_id(&self, state: &LayoutState, widget_id: WidgetID) -> anyhow::Result;
- /// Fetch a component by string ID and down‑cast it to a concrete component type `T` (see `components/mod.rs`)
+ /// Fetch a component by string ID and down-cast it to a concrete component type `T` (see `components/mod.rs`)
fn fetch_component_as(&self, id: &str) -> anyhow::Result>;
- /// Fetch a component by widget ID and down‑cast it to a concrete component type `T` (see `components/mod.rs`)
+ /// Fetch a component by widget ID and down-cast it to a concrete component type `T` (see `components/mod.rs`)
fn fetch_component_from_widget_id_as(
&self,
state: &LayoutState,
@@ -139,7 +139,7 @@ pub trait Fetchable {
/// Retrieve the widget associated with a string ID, returning a `WidgetPair` (id and widget itself)
fn fetch_widget(&self, state: &LayoutState, id: &str) -> anyhow::Result;
- /// Retrieve a widget by string ID and down‑cast its inner value to type `T` (see `widget/mod.rs`)
+ /// Retrieve a widget by string ID and down-cast its inner value to type `T` (see `widget/mod.rs`)
fn fetch_widget_as<'a, T: 'static>(&self, state: &'a LayoutState, id: &str) -> anyhow::Result>;
}