mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 07:00:30 +02:00
Add the cockpit, steering-wheel and hand-steering building blocks
The pure pieces of the first-person cockpit and hand steering, ported from
heurazy's mario-kart-wii-VR-port: the SteeringWheel grab/turn model, the
native wheel vertex rotation, the level seat stabiliser, the seated-eye and
wheel/handlebar geometry, and the XR_FB_hand_tracking_mesh loader. Adds
openxr_driving.h, the OpenXR-free snapshot the pacing thread will publish for
the guest thread, with the hand-off rule (a held wheel replaces the left
stick's X and releases that hand's grip for the game) and the wheel's
displayed angle.
New [vr] keys: first_person_seat (cockpit), cockpit_units_per_meter (100),
steering_wheel (true), native_steering_wheel (true), hand_steering (false)
and the seven wheel_* tuning keys. Nothing reads them yet.
The fresh-config template now writes the first-person defaults the
constants hold (50 / 1.5 / 0); d86dcb0 updated the constants but not the
template.
Tests: mkw_steering_wheel_tests (the fork's), mkw_vr_cockpit_tests,
mkw_vr_hand_steering_tests.
This commit is contained in:
1 parent
21b8d209dd
commit
50dc354123
12 files changed
+1547
-8
No files matched your search
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "vr/openxr_driving.h"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace mkw::vr {
|
||||
// Named rather than anonymous: runtime sources are unity-built in groups.
|
||||
namespace driving_bridge {
|
||||
|
||||
struct Published {
|
||||
std::mutex mutex;
|
||||
DrivingSnapshot snapshot{};
|
||||
};
|
||||
|
||||
Published& Get() {
|
||||
static Published published;
|
||||
return published;
|
||||
}
|
||||
|
||||
} // namespace driving_bridge
|
||||
|
||||
void OpenXRPublishDriving(const DrivingSnapshot& snapshot) noexcept {
|
||||
auto& published = driving_bridge::Get();
|
||||
std::lock_guard lock(published.mutex);
|
||||
published.snapshot = snapshot;
|
||||
}
|
||||
|
||||
DrivingSnapshot OpenXRReadDriving() noexcept {
|
||||
auto& published = driving_bridge::Get();
|
||||
std::lock_guard lock(published.mutex);
|
||||
return published.snapshot;
|
||||
}
|
||||
|
||||
} // namespace mkw::vr
|
||||
Reference in new issue
Block a user