本文整理汇总了C++中CBaseCombatWeapon::EnsureCorrectRenderingModel方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatWeapon::EnsureCorrectRenderingModel方法的具体用法?C++ CBaseCombatWeapon::EnsureCorrectRenderingModel怎么用?C++ CBaseCombatWeapon::EnsureCorrectRenderingModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatWeapon
的用法示例。
在下文中一共展示了CBaseCombatWeapon::EnsureCorrectRenderingModel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//.........这里部分代码省略.........
if ( m_pHL2MPPlayer->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_CROUCH_PRIMARYFIRE );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_STAND_PRIMARYFIRE );
iGestureActivity = ACT_VM_PRIMARYATTACK;
break;
}
case PLAYERANIMEVENT_VOICE_COMMAND_GESTURE:
{
if ( !IsGestureSlotActive( GESTURE_SLOT_ATTACK_AND_RELOAD ) )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, (Activity)nData );
break;
}
case PLAYERANIMEVENT_ATTACK_SECONDARY:
{
// Weapon secondary fire.
if ( m_pHL2MPPlayer->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_CROUCH_SECONDARYFIRE );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_STAND_SECONDARYFIRE );
iGestureActivity = ACT_VM_PRIMARYATTACK;
break;
}
case PLAYERANIMEVENT_ATTACK_PRE:
{
if ( m_pHL2MPPlayer->GetFlags() & FL_DUCKING )
{
// Weapon pre-fire. Used for minigun windup, sniper aiming start, etc in crouch.
iGestureActivity = ACT_MP_ATTACK_CROUCH_PREFIRE;
}
else
{
// Weapon pre-fire. Used for minigun windup, sniper aiming start, etc.
iGestureActivity = ACT_MP_ATTACK_STAND_PREFIRE;
}
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, iGestureActivity, false );
break;
}
case PLAYERANIMEVENT_ATTACK_POST:
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_STAND_POSTFIRE );
break;
}
case PLAYERANIMEVENT_RELOAD:
{
// Weapon reload.
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND );
break;
}
case PLAYERANIMEVENT_RELOAD_LOOP:
{
// Weapon reload.
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH_LOOP );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND_LOOP );
break;
}
case PLAYERANIMEVENT_RELOAD_END:
{
// Weapon reload.
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH_END );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND_END );
break;
}
default:
{
BaseClass::DoAnimationEvent( event, nData );
break;
}
}
#ifdef CLIENT_DLL
// Make the weapon play the animation as well
if ( iGestureActivity != ACT_INVALID )
{
CBaseCombatWeapon *pWeapon = GetHL2MPPlayer()->GetActiveWeapon();
if ( pWeapon )
{
pWeapon->EnsureCorrectRenderingModel();
pWeapon->SendWeaponAnim( iGestureActivity );
// Force animation events!
pWeapon->ResetEventsParity(); // reset event parity so the animation events will occur on the weapon.
pWeapon->DoAnimationEvents( pWeapon->GetModelPtr() );
}
}
#endif
}
示例2: DoAnimationEvent
//.........这里部分代码省略.........
if ( m_pSDKPlayer->m_Shared.IsProne() )
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_PRONE_LOOP );
}
else
#endif //SDK_USE_PRONE
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH_LOOP );
}
else
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND_LOOP );
}
iGestureActivity = ACT_INVALID; //TODO: fix
break;
}
case PLAYERANIMEVENT_RELOAD_END:
{
// Weapon reload.
#if defined ( SDK_USE_PRONE )
if ( m_pSDKPlayer->m_Shared.IsProne() )
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_PRONE_END );
}
else
#endif //SDK_USE_PRONE
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH_END );
}
else
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND_END );
}
iGestureActivity = ACT_INVALID; //TODO: fix
break;
}
#if defined ( SDK_USE_PRONE )
case PLAYERANIMEVENT_STAND_TO_PRONE:
{
m_bProneTransition = true;
m_bProneTransitionFirstFrame = true;
m_iProneActivity = ACT_MP_STAND_TO_PRONE;
RestartMainSequence();
iGestureActivity = ACT_VM_IDLE; //Clear for weapon, we have no stand->prone so just idle.
}
break;
case PLAYERANIMEVENT_CROUCH_TO_PRONE:
{
m_bProneTransition = true;
m_bProneTransitionFirstFrame = true;
m_iProneActivity = ACT_MP_CROUCH_TO_PRONE;
RestartMainSequence();
iGestureActivity = ACT_VM_IDLE; //Clear for weapon, we have no crouch->prone so just idle.
}
break;
case PLAYERANIMEVENT_PRONE_TO_STAND:
{
m_bProneTransition = true;
m_bProneTransitionFirstFrame = true;
m_iProneActivity = ACT_MP_PRONE_TO_STAND;
RestartMainSequence();
iGestureActivity = ACT_VM_IDLE; //Clear for weapon, we have no prone->stand so just idle.
}
break;
case PLAYERANIMEVENT_PRONE_TO_CROUCH:
{
m_bProneTransition = true;
m_bProneTransitionFirstFrame = true;
m_iProneActivity = ACT_MP_PRONE_TO_CROUCH;
RestartMainSequence();
iGestureActivity = ACT_VM_IDLE; //Clear for weapon, we have no prone->crouch so just idle.
}
break;
#endif
default:
{
BaseClass::DoAnimationEvent( event, nData );
break;
}
}
#ifdef CLIENT_DLL
// Make the weapon play the animation as well
if ( iGestureActivity != ACT_INVALID && GetSDKPlayer() != CSDKPlayer::GetLocalSDKPlayer())
{
CBaseCombatWeapon *pWeapon = GetSDKPlayer()->GetActiveWeapon();
if ( pWeapon )
{
pWeapon->EnsureCorrectRenderingModel();
pWeapon->SendWeaponAnim( iGestureActivity );
// Force animation events!
// pWeapon->ResetEventsParity(); // reset event parity so the animation events will occur on the weapon.
pWeapon->DoAnimationEvents( pWeapon->GetModelPtr() );
}
}
#endif
}