Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/xrGame/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2127,11 +2127,16 @@ bool CActor::AllowActorShadow()
void CActor::renderable_Render(IDSGraphManager* DM)
{
VERIFY(_valid(XFORM()));

if (cam_active == eacFirstEye)
{
if (::Render->active_phase() == 0) // can render first person body here
{
if (g_player_hud && psHUD_Flags.test(HUD_DRAW) && !m_holder)
{
g_player_hud->render_legs(DM);
}

//if (fpBody)
// inherited::renderable_Render(DM);
}
Expand All @@ -2144,7 +2149,7 @@ void CActor::renderable_Render(IDSGraphManager* DM)
}
}

// Third Person Body and Weapon/Item
// Third Person Body and Weapon/Item
else
{
inherited::renderable_Render(DM);
Expand Down
3 changes: 3 additions & 0 deletions src/xrGame/ActorAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ void CActor::g_SetAnimation(u32 mstate_rl)
else if (mstate_rl & mcLStrafe) M_legs = AS->legs_ls;
else if (mstate_rl & mcRStrafe) M_legs = AS->legs_rs;
else is_standing = true;
if (g_player_hud && is_standing && IsFocused() && g_player_hud->m_legs_controller.is_active()) {
is_standing = false;
}

if (mstate_rl & mcSprint)
{
Expand Down
8 changes: 7 additions & 1 deletion src/xrGame/Actor_Movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,13 @@ void CActor::g_Orientate(u32 mstate_rl, float dt)
}

// lerp angle for "effect" and capture torso data from camera
angle_lerp(r_model_yaw_delta, calc_yaw, PI_MUL_4, dt);
float scale_yaw_offset = 1.0f;

if (cam_active == eacFirstEye && g_player_hud && g_player_hud->m_legs_controller.is_active()) {
scale_yaw_offset = 0.15f;
}

angle_lerp(r_model_yaw_delta, calc_yaw * scale_yaw_offset, PI_MUL_4 * scale_yaw_offset, dt);

// build matrix
Fmatrix mXFORM;
Expand Down
14 changes: 14 additions & 0 deletions src/xrGame/IKLimbsController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ float CIKLimbsController::LegLengthShiftLimit(float current_shift, const SCalcul
if (shift_down < s_down)
shift_down = s_down;
}

if (Actor() == m_object) {
if (Actor()->active_cam() == EActorCameras::eacFirstEye) {
clamp(shift_down, -0.1f, 0.1f);
}
}

return shift_down;
}

Expand Down Expand Up @@ -193,6 +200,13 @@ bool CIKLimbsController::PredictObjectShift(const SCalculateData cd[max_size])

if (predict_time_shift < EPS_S)
predict_time_shift = Device.fTimeDelta;

if (Actor() == m_object) {
if (Actor()->active_cam() == EActorCameras::eacFirstEye) {
clamp(predict_shift, -0.1f, 0.1f);
}
}

_object_shift.set_taget(predict_shift, predict_time_shift);
return true;
}
Expand Down
5 changes: 5 additions & 0 deletions src/xrGame/console_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ extern BOOL g_allow_silencer_hide_tracer;

//demonized: new console vars
extern BOOL firstPersonDeath;
extern BOOL g_legs_enabled;
extern BOOL pseudogiantCanDamageObjects;
extern BOOL use_english_text_for_missing_translations;
namespace crash_saving {
Expand Down Expand Up @@ -3059,6 +3060,10 @@ void CCC_RegisterCommands()
CMD4(CCC_Integer, "first_person_death_direction_smoothing", &firstPersonDeathDirectionSmoothing, 1, 60);
CMD4(CCC_Float, "first_person_death_near_plane_offset", &viewportNearOffset, -.1f, .5f);

//legs

CMD4(CCC_Integer, "g_legs", &g_legs_enabled, 0, 1);

// PDA commands
CMD4(CCC_Integer, "pda_map_zoom_in_to_mouse", &pda_map_zoom_in_to_mouse, 0, 1);
CMD4(CCC_Integer, "pda_map_zoom_out_to_mouse", &pda_map_zoom_out_to_mouse, 0, 1);
Expand Down
Loading