Skip to content

Commit 6f7eb17

Browse files
committed
Add option to change the vehicle stick aim speed
1 parent 86399eb commit 6f7eb17

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

Code/GameCVars.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ void SCVars::InitVRCVars(IConsole* pConsole)
877877
pConsole->Register("vr_controller_stick_action_threshold", &vr_controller_stick_action_threshold, 0.75f, VF_RESTRICTEDMODE, "How far a stick needs to be extended to trigger an input action");
878878
pConsole->Register("vr_controller_stick_zone_cutoff", &vr_controller_stick_zone_cutoff, 0.25f, VF_RESTRICTEDMODE, "If stick is extended this far in one axis, disable any input actions in the other axis");
879879
pConsole->Register("vr_controller_yaw_speed", &vr_controller_yaw_speed, 45.f, VF_RESTRICTEDMODE|VF_DUMPTODISK, "Adjust smooth turn speed");
880+
pConsole->Register("vr_controller_vehicle_speed", &vr_controller_vehicle_speed, 0.7f, VF_RESTRICTEDMODE|VF_DUMPTODISK, "Adjust turn speed for vehicles");
880881
pConsole->Register("vr_weapon_hand", &vr_weapon_hand, 1, VF_RESTRICTEDMODE|VF_DUMPTODISK, "Which hand holds and controls weapon: 0 (left) or 1 (right)");
881882
pConsole->Register("vr_movement_hand", &vr_movement_hand, 0, VF_RESTRICTEDMODE|VF_DUMPTODISK, "Which hand controls player movement: 0 (left) or 1 (right)");
882883
pConsole->Register("vr_suit_hand", &vr_suit_hand, 1, VF_RESTRICTEDMODE|VF_DUMPTODISK, "Which hand controls the suit menu: 0 (left) or 1 (right)");

Code/GameCVars.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ struct SCVars
458458
float vr_controller_stick_action_threshold;
459459
float vr_controller_stick_zone_cutoff;
460460
float vr_controller_yaw_speed;
461+
float vr_controller_vehicle_speed;
461462
int vr_turn_mode;
462463
int vr_seated_mode;
463464
int vr_vehicle_2d;

Code/VR/VRGui.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ void VRGui::DrawSettingsMenu()
203203
bool invertVehicleY = g_pGameCVars->vr_vehicle_invert_y;
204204
ImGui::Checkbox("Invert look Y-axis for vehicles and mounted guns", &invertVehicleY);
205205
g_pGameCVars->vr_vehicle_invert_y = invertVehicleY;
206+
ImGui::SliderFloat("Vehicle aim speed", &g_pGameCVars->vr_controller_vehicle_speed, 0.1f, 2.0f, "%.2f");
206207

207208
ImGui::Text("Movement relative to");
208209
ImGui::SetItemTooltip("Choose if movement direction is relative to head or controller");

Code/VehicleClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ void CVehicleClient::OnAction(IVehicle* pVehicle, EntityId actorId, const Action
208208
}
209209
case (eVAI_XIRotateYaw):
210210
{
211+
value *= g_pGameCVars->vr_controller_vehicle_speed;
211212
IVehicleMovement *pMovement = pVehicle->GetMovement();
212213
if(pMovement && pMovement->GetMovementType() == IVehicleMovement::eVMT_Air && pVehicle->IsPlayerDriving())
213214
{
@@ -221,6 +222,7 @@ void CVehicleClient::OnAction(IVehicle* pVehicle, EntityId actorId, const Action
221222
}
222223
case (eVAI_XIRotatePitch):
223224
{
225+
value *= g_pGameCVars->vr_controller_vehicle_speed;
224226
IVehicleMovement *pMovement = pVehicle->GetMovement();
225227
if(pMovement && pMovement->GetMovementType() == IVehicleMovement::eVMT_Air && pVehicle->IsPlayerDriving())
226228
{

0 commit comments

Comments
 (0)