File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ static const float p_spin0_factor = 0.0f;
3030static const float p_spin1_factor = 0 .2f ;
3131static const float p_shoulder_factor = 0 .7f ;
3232static const float p_head_factor = 0 .1f ;
33+ static const float p_head_unarmed_factor = 0 .1f ;
3334static const float r_spin0_factor = 0 .3f ;
3435static const float r_spin1_factor = 0 .3f ;
3536static const float r_shoulder_factor = 0 .2f ;
@@ -80,13 +81,15 @@ void CActor::Spine2Callback(CBoneInstance* B)
8081 B->mTransform .mulA_43 (spin);
8182 B->mTransform .c = c;
8283}
84+ extern Fvector g_first_person_cam_offset;
8385void CActor::HeadCallback (CBoneInstance* B)
8486{
8587 CActor* A = static_cast <CActor*>(B->callback_param ());
8688 VERIFY (A);
8789 Fmatrix spin;
8890 float bone_yaw = angle_normalize_signed (A->r_torso .yaw - A->r_model_yaw - A->r_model_yaw_delta ) * y_head_factor;
89- float bone_pitch = angle_normalize_signed (A->r_torso .pitch ) * p_head_factor;
91+ float correctedHeadFactor = A->inventory ().GetActiveSlot () == NO_ACTIVE_SLOT ? p_head_unarmed_factor : p_head_factor;
92+ float bone_pitch = angle_normalize_signed (A->cam_Active ()->GetWorldPitch ()) * correctedHeadFactor;
9093 float bone_roll = angle_normalize_signed (A->r_torso .roll ) * r_head_factor;
9194 Fvector c = B->mTransform .c ;
9295 spin.setXYZ (-bone_pitch, bone_yaw, bone_roll);
You can’t perform that action at this time.
0 commit comments