mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 04:04:18 +02:00
Sit in the cockpit with hands on the wheel by default
First person already seats you in the cockpit, so hand steering belongs with it: the stick keeps steering until a grip actually takes hold of the wheel, and nothing else changes until it does. "yaw_pitch" becomes the default anchor for the same reason - from the driver's seat the vehicle's own climb reads as the ground rising, where a level horizon reads as the kart sinking away. Both defaults move together in runtime_config.h, the fresh-config template, the F10 menu's reset, and both launchers, which mirror the runtime's constants. The menu's reset also puts the rotation combo back on the default rather than on "yaw", and now covers hand steering with the other cockpit keys. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4438a300b8
commit
1d66ae87bf
5 files changed
+41
-27
No files matched your search
@@ -201,8 +201,10 @@ inline constexpr float kVrFirstPersonHeadRightDefault = 0.0f;
|
||||
inline constexpr bool kVrFirstPersonHideDriverDefault = true;
|
||||
inline constexpr int32_t kVrFirstPersonHiddenModelDefault = 0;
|
||||
inline constexpr float kVrFirstPersonHeadOffsetLimit = 10.0f;
|
||||
// "yaw", "yaw_pitch" or "full", matching FirstPersonRotation.
|
||||
inline constexpr const char* kVrFirstPersonRotationDefault = "yaw";
|
||||
// "yaw", "yaw_pitch" or "full", matching FirstPersonRotation. The cockpit seat
|
||||
// is the first-person default, and sitting in the vehicle reads better with its
|
||||
// climb than with a level horizon, so "yaw_pitch" is the default anchor.
|
||||
inline constexpr const char* kVrFirstPersonRotationDefault = "yaw_pitch";
|
||||
|
||||
inline bool IsSupportedVrFirstPersonRotation(std::string_view value) {
|
||||
return value == "yaw" || value == "yaw_pitch" || value == "full";
|
||||
@@ -221,11 +223,12 @@ inline constexpr float kVrCockpitUnitsPerMeterMax = 400.0f;
|
||||
// The vehicle's steering wheel or handlebar turns with the steering; the
|
||||
// vehicle's own model is animated unless native_steering_wheel is off, which
|
||||
// draws a separate VR wheel instead. Hand steering (grabbing that wheel with
|
||||
// the tracked controllers, by heurazy) is opt-in. The WheelWizard VR launcher
|
||||
// registers hand_steering with this same default.
|
||||
// the tracked controllers, by heurazy) comes with it: the stick still steers
|
||||
// until a grip actually takes hold of the wheel. Both launchers register
|
||||
// hand_steering with this same default.
|
||||
inline constexpr bool kVrSteeringWheelDefault = true;
|
||||
inline constexpr bool kVrNativeSteeringWheelDefault = true;
|
||||
inline constexpr bool kVrHandSteeringDefault = false;
|
||||
inline constexpr bool kVrHandSteeringDefault = true;
|
||||
// Hand steering tuning ranges; the defaults are mkw::vr::WheelTuning's.
|
||||
inline constexpr float kVrWheelDegreesMin = 20.0f, kVrWheelDegreesMax = 180.0f;
|
||||
inline constexpr float kVrWheelGrabDistanceMin = 0.15f, kVrWheelGrabDistanceMax = 0.8f;
|
||||
@@ -531,7 +534,7 @@ inline void EnsureConfigFile() {
|
||||
"# Where the view's orientation comes from: \"yaw\" levels the\n"
|
||||
"# horizon, \"yaw_pitch\" adds the kart's climb but no roll, and\n"
|
||||
"# \"full\" takes the kart's whole orientation so the view banks.\n"
|
||||
"first_person_rotation = \"yaw\"\n"
|
||||
"first_person_rotation = \"yaw_pitch\"\n"
|
||||
"# In the cockpit the vehicle's steering wheel or handlebar turns\n"
|
||||
"# with the steering. native_steering_wheel animates the vehicle's\n"
|
||||
"# own model; false draws a separate VR wheel instead.\n"
|
||||
@@ -545,7 +548,7 @@ inline void EnsureConfigFile() {
|
||||
"# the wheel, how quickly the wheel follows the hands, how long\n"
|
||||
"# (seconds) a hand that loses tracking keeps hold, and a short\n"
|
||||
"# pulse on grab and release. All changeable live from the F10 menu.\n"
|
||||
"hand_steering = false\n"
|
||||
"hand_steering = true\n"
|
||||
"wheel_kart_degrees = 90.0\n"
|
||||
"wheel_bike_degrees = 45.0\n"
|
||||
"wheel_grab_distance = 0.35\n"
|
||||
|
||||
@@ -207,15 +207,15 @@ int g_vrControllerMode = [] {
|
||||
return 0;
|
||||
}();
|
||||
constexpr std::array<const char*, 3> kVrFirstPersonRotationNames{"yaw", "yaw_pitch", "full"};
|
||||
int g_vrFirstPersonRotation = [] {
|
||||
const std::string mode = RuntimeConfigFile::VrFirstPersonRotation();
|
||||
int VrFirstPersonRotationIndex(std::string_view mode) {
|
||||
for (size_t i = 0; i < kVrFirstPersonRotationNames.size(); ++i) {
|
||||
if (mode == kVrFirstPersonRotationNames[i]) {
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}();
|
||||
}
|
||||
int g_vrFirstPersonRotation = VrFirstPersonRotationIndex(RuntimeConfigFile::VrFirstPersonRotation());
|
||||
// SDL_SCANCODE_UNKNOWN means unbound, which is also what an unrecognised
|
||||
// name in the config file resolves to rather than silently picking a key.
|
||||
SDL_Scancode g_vrRecenterScancode = [] {
|
||||
@@ -1618,17 +1618,20 @@ void DrawVrSettings() {
|
||||
g_vrCockpitUnitsPerMeter = RuntimeConfigFile::kVrCockpitUnitsPerMeterDefault;
|
||||
g_vrSteeringWheel = RuntimeConfigFile::kVrSteeringWheelDefault;
|
||||
g_vrNativeSteeringWheel = RuntimeConfigFile::kVrNativeSteeringWheelDefault;
|
||||
g_vrHandSteering = RuntimeConfigFile::kVrHandSteeringDefault;
|
||||
RuntimeConfigFile::SetVrFirstPersonSeat(RuntimeConfigFile::kVrFirstPersonSeatDefault);
|
||||
RuntimeConfigFile::SetVrCockpitUnitsPerMeter(g_vrCockpitUnitsPerMeter);
|
||||
RuntimeConfigFile::SetVrSteeringWheel(g_vrSteeringWheel);
|
||||
RuntimeConfigFile::SetVrNativeSteeringWheel(g_vrNativeSteeringWheel);
|
||||
RuntimeConfigFile::SetVrHandSteering(g_vrHandSteering);
|
||||
g_vrFirstPersonUnitsPerMeter = RuntimeConfigFile::kVrFirstPersonUnitsPerMeterDefault;
|
||||
g_vrFirstPersonHeadUp = RuntimeConfigFile::kVrFirstPersonHeadUpDefault;
|
||||
g_vrFirstPersonHeadForward = RuntimeConfigFile::kVrFirstPersonHeadForwardDefault;
|
||||
g_vrFirstPersonHeadRight = RuntimeConfigFile::kVrFirstPersonHeadRightDefault;
|
||||
g_vrFirstPersonHideDriver = RuntimeConfigFile::kVrFirstPersonHideDriverDefault;
|
||||
g_vrFirstPersonHiddenModel = RuntimeConfigFile::kVrFirstPersonHiddenModelDefault;
|
||||
g_vrFirstPersonRotation = 0;
|
||||
g_vrFirstPersonRotation =
|
||||
VrFirstPersonRotationIndex(RuntimeConfigFile::kVrFirstPersonRotationDefault);
|
||||
RuntimeConfigFile::SetVrFirstPersonRotation(
|
||||
RuntimeConfigFile::kVrFirstPersonRotationDefault);
|
||||
RuntimeConfigFile::SetVrFirstPersonUnitsPerMeter(g_vrFirstPersonUnitsPerMeter);
|
||||
|
||||
Reference in new issue
Block a user