Пример #1
0
void ClientModeSDKNormal::OverrideView( CViewSetup *pSetup )
{
	QAngle camAngles;

	// Let the player override the view.
	C_BasePlayer *pPlayer = C_SDKPlayer::GetLocalOrSpectatedPlayer();
	if(!pPlayer)
		return;

	pPlayer->OverrideView( pSetup );

	if( ::input->CAM_IsThirdPerson() && pPlayer->IsAlive() )
	{
		Vector cam_ofs = g_ThirdPersonManager.GetCameraOffsetAngles();

		camAngles[ PITCH ] = cam_ofs[ PITCH ];
		camAngles[ YAW ] = cam_ofs[ YAW ];
		camAngles[ ROLL ] = 0;

		Vector camForward, camRight, camUp;
		AngleVectors( camAngles, &camForward, &camRight, &camUp );

		VectorMA( pSetup->origin, -cam_ofs[ ROLL ], camForward, pSetup->origin );

		// Override angles from third person camera
		float flRoll = pSetup->angles.z;
		pSetup->angles = camAngles;
		pSetup->angles.z = flRoll;
	}
}
void ClientModeHLNormal::OverrideView( CViewSetup *pSetup )
{
	// Let the player override the view.
	C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
	if(!pPlayer)
		return;

	pPlayer->OverrideView( pSetup );
	BaseClass::OverrideView( pSetup );
}