@@ -203,9 +203,9 @@ void handleLeftHandInGameInput(
203203) {
204204 constexpr std::chrono::milliseconds INPUT_DELAY (400 );
205205
206- static const RumbleParameters leftRumbleRaise = { true , 0 , RumbleType::Raising, 0 .5f , false , 0.2 , 1 .0f , 1 .0f };
207- static const RumbleParameters leftRumbleFall = { true , 0 , RumbleType::Falling, 0 .5f , false , 0.3 , 0 .1f , 0 .75f };
208- static const RumbleParameters RuneRumble = { true , 0 , RumbleType::OscillationSmooth, 1 .0f , false , 1.0 , 0 .25f , 0 .25f };
206+ constexpr RumbleParameters leftRumbleRaise = { true , 0 , RumbleType::Raising, 0 .5f , false , 0.2 , 1 .0f , 1 .0f };
207+ constexpr RumbleParameters leftRumbleFall = { true , 0 , RumbleType::Falling, 0 .5f , false , 0.3 , 0 .1f , 0 .75f };
208+ constexpr RumbleParameters RuneRumble = { true , 0 , RumbleType::OscillationSmooth, 1 .0f , false , 1.0 , 0 .25f , 0 .25f };
209209
210210 auto * rumbleMgr = VRManager::instance ().XR ->GetRumbleManager ();
211211 bool isGrabPressed = inputs.inGame .grabState [0 ].lastEvent == ButtonState::Event::ShortPress;
@@ -374,8 +374,8 @@ void handleRightHandInGameInput(
374374) {
375375 constexpr std::chrono::milliseconds INPUT_DELAY (400 );
376376
377- static const RumbleParameters rightRumbleFall = { true , 1 , RumbleType::Falling, 0 .5f , false , 0.3 , 0 .1f , 0 .75f };
378- static const RumbleParameters rightRumbleInfiniteRaise = { true , 1 , RumbleType::Raising, 0 .5f , true , 1.0 , 0 .25f , 0 .25f };
377+ constexpr RumbleParameters rightRumbleFall = { true , 1 , RumbleType::Falling, 0 .5f , false , 0.3 , 0 .1f , 0 .75f };
378+ constexpr RumbleParameters rightRumbleInfiniteRaise = { true , 1 , RumbleType::Raising, 0 .5f , true , 1.0 , 0 .25f , 0 .25f };
379379
380380 auto * rumbleMgr = VRManager::instance ().XR ->GetRumbleManager ();
381381 bool isGrabPressedShort = inputs.inGame .grabState [1 ].lastEvent == ButtonState::Event::ShortPress;
@@ -535,12 +535,12 @@ void handleLeftTriggerBindings(
535535 return ;
536536 }
537537
538- static const RumbleParameters raiseRumble = { true , 0 , RumbleType::Raising, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
539- static const RumbleParameters fallRumble = { true , 0 , RumbleType::Falling, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
538+ constexpr RumbleParameters raiseRumble = { true , 0 , RumbleType::Raising, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
539+ constexpr RumbleParameters fallRumble = { true , 0 , RumbleType::Falling, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
540540
541541 auto * rumbleMgr = VRManager::instance ().XR ->GetRumbleManager ();
542542
543- // Guard + lock on
543+ // Guard + lock on
544544 // Reset the guard state to trigger again the lock on camera
545545 if (!gameState.is_locking_on_target && gameState.previous_button_hold & VPAD_BUTTON_ZL) {
546546 // cancel rune use to let the shield guard happen
@@ -576,11 +576,11 @@ void handleRightTriggerBindings(
576576 return ;
577577 }
578578
579- const static RumbleParameters rightRumbleFixed = { true , 1 , RumbleType::Fixed, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
580- const static RumbleParameters leftRumbleFixed = { true , 0 , RumbleType::Fixed, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
581- static const RumbleParameters rightRumbleInfiniteRaiseBow = { true , 1 , RumbleType::Raising, 0 .5f , true , 1.0 , 0 .25f , 0 .25f };
582- static const RumbleParameters rightRumbleInfiniteRaiseWeaponThrow = { true , 1 , RumbleType::Raising, 0 .5f , true , 1.0 , 0 .25f , 0 .25f };
583- static const RumbleParameters rightRumbleFiniteRaise = { true , 1 , RumbleType::Raising, 0 .5f , false , 0.25 , 1 .0f , 1 .0f };
579+ constexpr RumbleParameters rightRumbleFixed = { true , 1 , RumbleType::Fixed, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
580+ constexpr RumbleParameters leftRumbleFixed = { true , 0 , RumbleType::Fixed, 0 .5f , false , 0.25 , 0 .3f , 0 .3f };
581+ constexpr RumbleParameters rightRumbleInfiniteRaiseBow = { true , 1 , RumbleType::Raising, 0 .5f , true , 1.0 , 0 .25f , 0 .25f };
582+ constexpr RumbleParameters rightRumbleInfiniteRaiseWeaponThrow = { true , 1 , RumbleType::Raising, 0 .5f , true , 1.0 , 0 .25f , 0 .25f };
583+ constexpr RumbleParameters rightRumbleFiniteRaise = { true , 1 , RumbleType::Raising, 0 .5f , false , 0.25 , 1 .0f , 1 .0f };
584584
585585
586586 if (gameState.has_something_in_hand ) {
@@ -673,6 +673,8 @@ void CemuHooks::hook_InjectXRInput(PPCInterpreter_t* hCPU) {
673673 readMemory (vpadStatusOffset, &vpadStatus);
674674 }
675675
676+ auto * rumbleMgr = VRManager::instance ().XR ->GetRumbleManager ();
677+
676678 // fetch input state
677679 OpenXR::InputState inputs = VRManager::instance ().XR ->m_input .load ();
678680 inputs.inGame .drop_weapon [0 ] = inputs.inGame .drop_weapon [1 ] = false ;
@@ -736,7 +738,7 @@ void CemuHooks::hook_InjectXRInput(PPCInterpreter_t* hCPU) {
736738 rightGesture = calculateHandGesture (gameState, rightHandPos, headsetMtx, headsetPos, gameState.right_hand_position_stored , gameState.stored_right_hand_position );
737739 }
738740
739- // dpad menu toggle
741+ // dpad menu toggle
740742 if (gameState.dpad_menu_open )
741743 {
742744 switch (gameState.last_dpad_menu_open ) {
@@ -805,11 +807,11 @@ void CemuHooks::hook_InjectXRInput(PPCInterpreter_t* hCPU) {
805807 else
806808 newXRBtnHold |= mapXRButtonToVpad (inputs.inGame .run_interact_cancel , VPAD_BUTTON_A);
807809 }
808-
809- // Wistle gesture
810+
811+ // Whistle gesture
810812 if (isHandOverMouthSlot (leftGesture) && isHandOverMouthSlot (rightGesture)) {
811813 if (inputs.inGame .grabState [0 ].wasDownLastFrame && inputs.inGame .grabState [1 ].wasDownLastFrame ) {
812- static const RumbleParameters rumble = { true , 0 , RumbleType::OscillationRaisingSawtoothWave, 1 .0f , false , 0.25 , 0 .2f , 0 .2f };
814+ rumbleMgr-> enqueueInputsRumbleCommand ( { true , 0 , RumbleType::OscillationRaisingSawtoothWave, 1 .0f , false , 0.25 , 0 .2f , 0 .2f }) ;
813815 VRManager::instance ().XR ->GetRumbleManager ()->enqueueInputsRumbleCommand (rumble);
814816 newXRBtnHold |= VPAD_BUTTON_DOWN;
815817 }
@@ -829,7 +831,7 @@ void CemuHooks::hook_InjectXRInput(PPCInterpreter_t* hCPU) {
829831 // if (inputs.inGame.leftTrigger.currentState &&
830832 // gameState.left_equip_type == EquipType::Rune) {
831833 // RumbleParameters rumble = { true, 1, 0.5f, false, 0.25, 0.3f, 0.3f };
832- // VRManager::instance().XR->GetRumbleManager() ->enqueueInputsRumbleCommand(rumble);
834+ // rumbleMgr ->enqueueInputsRumbleCommand(rumble);
833835 // newXRBtnHold |= VPAD_BUTTON_B;
834836 // }
835837 }
@@ -838,7 +840,7 @@ void CemuHooks::hook_InjectXRInput(PPCInterpreter_t* hCPU) {
838840 }
839841
840842 // Update rumble/haptics
841- VRManager::instance (). XR -> GetRumbleManager () ->updateHaptics ();
843+ rumbleMgr ->updateHaptics ();
842844
843845
844846
0 commit comments