MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CG_SetClientViewAngles

Function CG_SetClientViewAngles

codeJK2/cgame/cg_predict.cpp:202–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201
202void CG_SetClientViewAngles( vec3_t angles, qboolean overrideViewEnt )
203{
204 if ( cg.snap->ps.viewEntity <= 0 || cg.snap->ps.viewEntity >= ENTITYNUM_WORLD || overrideViewEnt )
205 {//don't clamp angles when looking through a viewEntity
206 for( int i = 0; i < 3; i++ )
207 {
208 cg.predicted_player_state.viewangles[PITCH] = angles[i];
209 cg.predicted_player_state.delta_angles[i] = 0;
210 cg.snap->ps.viewangles[PITCH] = angles[i];
211 cg.snap->ps.delta_angles[i] = 0;
212 g_entities[0].client->pers.cmd_angles[i] = ANGLE2SHORT(angles[i]);
213 }
214 cgi_SetUserCmdAngles( angles[PITCH], angles[YAW], angles[ROLL] );
215 }
216}
217
218extern qboolean PM_AdjustAnglesToGripper( gentity_t *gent, usercmd_t *cmd );
219extern qboolean PM_AdjustAngleForWallRun( gentity_t *ent, usercmd_t *ucmd, qboolean doMove );

Callers 3

CG_CheckModifyUCmdFunction · 0.70
G_ClearViewEntityFunction · 0.50
G_SetViewEntityFunction · 0.50

Calls 1

cgi_SetUserCmdAnglesFunction · 0.70

Tested by

no test coverage detected