Skip to content

Commit a2b5744

Browse files
committed
Separate pitch rotation for head and torso, remove unused wip code
1 parent f258b41 commit a2b5744

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/xrGame/ActorAnimation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ void CActor::Spine2Callback(CBoneInstance* B)
7474
float bone_yaw = angle_normalize_signed(A->r_torso.yaw - A->r_model_yaw - A->r_model_yaw_delta) * y_shoulder_factor;
7575
float bone_pitch = angle_normalize_signed(A->r_torso.pitch) * p_shoulder_factor;
7676
float bone_roll = angle_normalize_signed(A->r_torso.roll) * r_shoulder_factor;
77+
float correctedPitch = A->inventory().GetActiveSlot() == NO_ACTIVE_SLOT ? 0.f : bone_pitch; // yohji: force arms pitch to be neutral when we are unarmed
7778
Fvector c = B->mTransform.c;
78-
spin.setXYZ(-bone_pitch, bone_yaw, bone_roll);
79+
spin.setXYZ(-correctedPitch, bone_yaw, bone_roll);
7980
B->mTransform.mulA_43(spin);
8081
B->mTransform.c = c;
8182
}

src/xrGame/Actor_Movement.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,6 @@ void CActor::g_cl_Orientate(u32 mstate_rl, float dt)
509509
r_torso.pitch = cam_FirstEye()->GetWorldPitch();
510510
}
511511

512-
float fpYawOffset = (g_first_person_cam_offset.x * 10.f) * (PI / 180.f);
513-
if (FirstPersonBodyActive())
514-
{
515-
r_torso.yaw += fpYawOffset;
516-
if (inventory().GetActiveSlot() == NO_ACTIVE_SLOT)
517-
r_torso.pitch = 0.f; // yohji: ignore pitch rotations for first person body when unarmed so arms remain in neutral state regardless of where camera is pointed
518-
}
519-
520512
unaffected_r_torso.yaw = r_torso.yaw;
521513
unaffected_r_torso.pitch = r_torso.pitch;
522514
unaffected_r_torso.roll = r_torso.roll;
@@ -533,7 +525,7 @@ void CActor::g_cl_Orientate(u32 mstate_rl, float dt)
533525
// если есть движение - выровнять модель по камере
534526
if (mstate_rl & mcAnyMove)
535527
{
536-
r_model_yaw = angle_normalize(r_torso.yaw - fpYawOffset);
528+
r_model_yaw = angle_normalize(r_torso.yaw);
537529
mstate_real &= ~mcTurn;
538530
}
539531
else

0 commit comments

Comments
 (0)