Add Flat Screen mode for VR races and update settings accordingly

This commit is contained in:
iChris4 committed 2026-09-23 17:15:53 +02:00
1 parent 2a89fac79d
commit 2a4686191e
16 files changed
+161 -50

No files matched your search

+4
View File
@@ -71,6 +71,7 @@ inline constexpr uint32_t kMkwVRRequiredImmersiveBindings =
struct MkwVRPolicyConfig {
bool enabled = false;
// False is Flat Screen mode: races stay on the virtual screen the menus use.
bool immersive_races = true;
float world_units_per_meter = 500.0f;
float hud_distance_meters = 2.0f;
@@ -151,6 +152,9 @@ void MkwVRPolicySetFirstPersonEngaged(bool engaged) noexcept;
// MkwVRPolicyConfigure so the F10 slider can retune it during a race without
// republishing (and revalidating) the whole configuration.
void MkwVRPolicySetFirstPersonUnitsPerMeter(float units_per_meter) noexcept;
// Flat Screen mode, live from the F10 menu. Unlike the scale above this changes
// which content is safe to present, so it advances the safety generation.
void MkwVRPolicySetImmersiveRaces(bool enabled) noexcept;
MkwVRPolicySnapshot MkwVRPolicyGetSnapshot() noexcept;
// This classifier is deliberately structural rather than heuristic: future
+5 -4
View File
@@ -79,10 +79,11 @@ inline float MaxWheelAngle(bool bike, const WheelTuning& tuning) noexcept {
return clamped * 0.01745329252f;
}
// Grips only grab. While a hand holds the wheel its squeeze is released for the
// game, where it would press C on the Nunchuk or a shoulder on the gamepad, and
// the wheel replaces the left stick's X axis, which both controller modes steer
// with. The stick's Y axis keeps aiming items forwards and backwards.
// Grips only grab. As a Wii Remote they press nothing at all (C, the game's
// look-behind, is right B); as a gamepad they are the shoulders, so a holding
// hand's squeeze is released for the game. The wheel replaces the left stick's
// X axis, which both controller modes steer with, and the stick's Y axis keeps
// aiming items forwards and backwards.
inline void ApplyHandSteering(std::array<wii_remote::HandInputs, 2>& hands, const WheelState& wheel) noexcept {
for (size_t hand = 0; hand < hands.size(); ++hand) {
if (wheel.held[hand]) {
+2 -1
View File
@@ -63,7 +63,8 @@ struct OpenXRPointerScreen {
// the seated frame every frame. With hand steering on, a squeezed grip near the
// steering wheel or handlebar takes hold of it; while held, the wheel replaces
// the left stick's X axis in both presentations and that grip no longer reaches
// the game (C on the Nunchuk, a shoulder on the gamepad).
// the game (a shoulder on the gamepad; as a Wii Remote the grips are unbound,
// so a hand on the wheel cannot hold down a button).
//
// A right-thumbstick click on its own toggles the first-person camera, as its
// F10 checkbox does (first_person_toggle_click).
+5 -3
View File
@@ -342,10 +342,12 @@ struct HandInputs {
// Adapted from DolphinXR's default "OpenXR Wii Remote" profile
// (Data/Sys/Profiles/Wiimote):
// right A -> A, right trigger -> B, right stick up/down -> 1/2,
// right A -> A, right trigger -> B, right B -> C, right stick up/down -> 1/2,
// left X -> -, left menu -> +,
// left grip -> C, left trigger -> Z, left stick -> Nunchuk stick.
// left trigger -> Z, left stick -> Nunchuk stick.
// HOME has no button; left Y opens the settings panel (openxr_settings_panel.h).
// The grips press nothing: they take hold of the wheel (openxr_driving.h), and C
// is the game's look-behind, which a hand on the wheel would otherwise hold down.
inline uint32_t RemoteButtons(const HandInputs& left, const HandInputs& right) noexcept {
uint32_t hold = 0;
const auto press = [&hold](bool held, uint32_t bit) {
@@ -355,11 +357,11 @@ inline uint32_t RemoteButtons(const HandInputs& left, const HandInputs& right) n
};
press(right.primary, kButtonA);
press(right.trigger > kPressThreshold, kButtonB);
press(right.secondary, kButtonC);
press(right.stick_y > kPressThreshold, kButtonOne);
press(right.stick_y < -kPressThreshold, kButtonTwo);
press(left.primary, kButtonMinus);
press(left.menu, kButtonPlus);
press(left.squeeze > kPressThreshold, kButtonC);
press(left.trigger > kPressThreshold, kButtonZ);
return hold;
}