Skip to content

Commit

Permalink
Merge pull request #6394 from Goober5000/fix_camera_shudder
Browse files Browse the repository at this point in the history
fix camera shudder
  • Loading branch information
Goober5000 authored Oct 28, 2024
2 parents 9852247 + 1570f72 commit 79a9acb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/parse/sexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41301,7 +41301,7 @@ SCP_vector<sexp_help_struct> Sexp_help = {
},

{ OP_SET_CAMERA_SHUDDER, "set-camera-shudder\r\n"
"\tCauses the camera to shudder. Currently this will only work if the camera is showing the player's viewpoint (i.e. the HUD).\r\n\r\n"
"\tCauses the camera to shudder. Normally this will only work if the camera is showing the player's viewpoint (i.e. the HUD), unless the Everywhere flag is set.\r\n\r\n"
"Takes 2 to 4 arguments...\r\n"
"\t1: Time (in milliseconds)\r\n"
"\t2: Intensity. For comparison, the Maxim has an intensity of 1440.\r\n"
Expand Down
8 changes: 5 additions & 3 deletions freespace2/freespace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3424,7 +3424,6 @@ void game_render_frame( camid cid, const vec3d* offset, const matrix* rot_offset
g3_start_frame(game_zbuffer);

camera *cam = cid.getCamera();
matrix eye_no_jitter = vmd_identity_matrix;

if(cam != nullptr)
{
Expand All @@ -3445,10 +3444,13 @@ void game_render_frame( camid cid, const vec3d* offset, const matrix* rot_offset
}

//Handle jitter if not cutscene camera
eye_no_jitter = eye_orient;
if( !(Viewer_mode & VM_FREECAMERA) ) {
apply_view_shake(&eye_orient);
cam->set_rotation(&eye_orient);
cam->set_rotation(&eye_orient); // this was added in 57fbb21c; see Mantis 1743; needed to make the target indicator shake
}
//If cutscene camera, handle jitter differently
else if ( Game_shudder_everywhere ) {
apply_view_shake(&eye_orient); // the camera rotation shouldn't be modified for cutscenes or it will produce feedback
}

//Maybe override FOV from SEXP
Expand Down

0 comments on commit 79a9acb

Please sign in to comment.