本文整理汇总了C++中CBaseCombatWeapon::ShouldUseLargeViewModelVROverride方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatWeapon::ShouldUseLargeViewModelVROverride方法的具体用法?C++ CBaseCombatWeapon::ShouldUseLargeViewModelVROverride怎么用?C++ CBaseCombatWeapon::ShouldUseLargeViewModelVROverride使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatWeapon
的用法示例。
在下文中一共展示了CBaseCombatWeapon::ShouldUseLargeViewModelVROverride方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalcViewModelView
void CBaseViewModel::CalcViewModelView( CBasePlayer *owner, const Vector& eyePosition, const QAngle& eyeAngles )
{
// UNDONE: Calc this on the server? Disabled for now as it seems unnecessary to have this info on the server
#if defined( CLIENT_DLL )
QAngle vmangoriginal = eyeAngles;
QAngle vmangles = eyeAngles;
Vector vmorigin = eyePosition;
CBaseCombatWeapon *pWeapon = m_hWeapon.Get();
//Allow weapon lagging
if ( pWeapon != NULL )
{
#if defined( CLIENT_DLL )
if ( !prediction->InPrediction() )
#endif
{
// add weapon-specific bob
pWeapon->AddViewmodelBob( this, vmorigin, vmangles );
#if defined ( CSTRIKE_DLL )
CalcViewModelLag( vmorigin, vmangles, vmangoriginal );
#endif
}
}
// Add model-specific bob even if no weapon associated (for head bob for off hand models)
AddViewModelBob( owner, vmorigin, vmangles );
#if !defined ( CSTRIKE_DLL )
// This was causing weapon jitter when rotating in updated CS:S; original Source had this in above InPrediction block 07/14/10
// Add lag
CalcViewModelLag( vmorigin, vmangles, vmangoriginal );
#endif
#if defined( CLIENT_DLL )
if ( !prediction->InPrediction() )
{
// Let the viewmodel shake at about 10% of the amplitude of the player's view
vieweffects->ApplyShake( vmorigin, vmangles, 0.1 );
}
#endif
if( UseVR() )
{
g_ClientVirtualReality.OverrideViewModelTransform( vmorigin, vmangles, pWeapon && pWeapon->ShouldUseLargeViewModelVROverride() );
}
SetLocalOrigin( vmorigin );
SetLocalAngles( vmangles );
#ifdef SIXENSE
if( g_pSixenseInput->IsEnabled() && (owner->GetObserverMode()==OBS_MODE_NONE) && !UseVR() )
{
const float max_gun_pitch = 20.0f;
float viewmodel_fov_ratio = g_pClientMode->GetViewModelFOV()/owner->GetFOV();
QAngle gun_angles = g_pSixenseInput->GetViewAngleOffset() * -viewmodel_fov_ratio;
// Clamp pitch a bit to minimize seeing back of viewmodel
if( gun_angles[PITCH] < -max_gun_pitch )
{
gun_angles[PITCH] = -max_gun_pitch;
}
#ifdef WIN32 // ShouldFlipViewModel comes up unresolved on osx? Mabye because it's defined inline? fixme
if( ShouldFlipViewModel() )
{
gun_angles[YAW] *= -1.0f;
}
#endif
vmangles = EyeAngles() + gun_angles;
SetLocalAngles( vmangles );
}
#endif
#endif
}