@@ -181,14 +181,6 @@ void CemuHooks::hook_UpdateCameraForGameplay(PPCInterpreter_t* hCPU) {
181181 }
182182
183183
184- if (auto eventSettings = GetFirstPersonSettingsForActiveEvent ()) {
185- if (eventSettings->ignoreCameraRotation ) {
186- glm::fquat playerRot = mtx.getRotLE ();
187- auto [swing, baseYaw] = swingTwistY (playerRot);
188- s_wsCameraRotation = baseYaw * glm::angleAxis (glm::radians (180 .0f ), glm::fvec3 (0 .0f , 1 .0f , 0 .0f ));
189- }
190- }
191-
192184 if (s_isLadderClimbing > 0 ) {
193185 s_isLadderClimbing--;
194186 }
@@ -320,15 +312,6 @@ void CemuHooks::hook_GetRenderCamera(PPCInterpreter_t* hCPU) {
320312 }
321313
322314 basePos = playerPos;
323- if (auto eventSettings = GetFirstPersonSettingsForActiveEvent ()) {
324-
325- if (eventSettings->ignoreCameraRotation ) {
326- glm::fquat playerRot = playerMtx.getRotLE ();
327- auto [swing, yaw] = swingTwistY (playerRot);
328- baseYaw = yaw * glm::angleAxis (glm::radians (180 .0f ), glm::fvec3 (0 .0f , 1 .0f , 0 .0f ));
329- baseYawWithoutClimbingFix = yaw * glm::angleAxis (glm::radians (180 .0f ), glm::fvec3 (0 .0f , 1 .0f , 0 .0f ));
330- }
331- }
332315 }
333316
334317 s_lastCameraMtx = glm::fmat4x3 (glm::translate (glm::identity<glm::fmat4>(), basePos) * glm::mat4 (baseYawWithoutClimbingFix));
@@ -556,15 +539,6 @@ void CemuHooks::hook_ModifyProjectionUsingCamera(PPCInterpreter_t* hCPU) {
556539 // take link's direction, then rotate the headset position
557540 BEMatrix34 playerMtx = {};
558541 readMemory (s_playerMtxAddress, &playerMtx);
559-
560- if (auto eventSettings = GetFirstPersonSettingsForActiveEvent ()) {
561-
562- if (eventSettings->ignoreCameraRotation ) {
563- glm::fquat playerRot = playerMtx.getRotLE ();
564- auto [swing, yaw] = swingTwistY (playerRot);
565- baseYaw = yaw * glm::angleAxis (glm::radians (180 .0f ), glm::fvec3 (0 .0f , 1 .0f , 0 .0f ));
566- }
567- }
568542 }
569543
570544 // vr camera
@@ -667,13 +641,6 @@ std::pair<glm::vec3, glm::fquat> CemuHooks::CalculateVRWorldPose(const BESeadLoo
667641 }
668642
669643 basePos = playerPos;
670- if (auto eventSettings = GetFirstPersonSettingsForActiveEvent ()) {
671- if (eventSettings->ignoreCameraRotation ) {
672- glm::fquat playerRot = playerMtx.getRotLE ();
673- auto [swing, yaw] = swingTwistY (playerRot);
674- baseYaw = yaw * glm::angleAxis (glm::radians (180 .0f ), glm::fvec3 (0 .0f , 1 .0f , 0 .0f ));
675- }
676- }
677644 }
678645
679646 // vr camera
@@ -943,6 +910,23 @@ void CemuHooks::hook_GetEventName(PPCInterpreter_t* hCPU) {
943910 }
944911}
945912
913+ void CemuHooks::hook_ShouldSkipEventCamera (PPCInterpreter_t* hCPU) {
914+ hCPU->instructionPointer = hCPU->sprNew .LR ;
915+
916+ if (IsFirstPerson ()) {
917+ // disable camera rotation for first-person events, according to the event settings
918+ if (auto eventSettings = GetFirstPersonSettingsForActiveEvent ()) {
919+ if (eventSettings->ignoreCameraRotation ) {
920+ hCPU->gpr [3 ] = 1 ;
921+ return ;
922+ }
923+ }
924+ }
925+
926+ // return 0 to just follow regular camera rotation
927+ hCPU->gpr [3 ] = 0 ;
928+ }
929+
946930struct CameraParamValueOffset {
947931 std::string name;
948932 uint32_t offsetInsideCamera;
@@ -996,6 +980,8 @@ void CemuHooks::hook_ReplaceCameraMode(PPCInterpreter_t* hCPU) {
996980 constexpr uint32_t kCameraAiming2Vtbl = 0X101B2EB4 ;
997981 constexpr uint32_t kCameraMagneCatchVtbl = 0x101BAB4C ;
998982
983+ // hCPU->gpr[3] = cameraChaseInstance;
984+
999985 if (hCPU->gpr [5 ] == kCameraMagneCatchVtbl ) {
1000986 if (IsFirstPerson ()) {
1001987 // hCPU->gpr[3] = cameraChaseMode;
0 commit comments