当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseCombatWeapon::DoAnimationEvents方法代码示例

本文整理汇总了C++中CBaseCombatWeapon::DoAnimationEvents方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatWeapon::DoAnimationEvents方法的具体用法?C++ CBaseCombatWeapon::DoAnimationEvents怎么用?C++ CBaseCombatWeapon::DoAnimationEvents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBaseCombatWeapon的用法示例。


在下文中一共展示了CBaseCombatWeapon::DoAnimationEvents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoAnimationEvent


//.........这里部分代码省略.........
			m_bDiveStartFirstFrame = true;
			m_iDiveActivity = ACT_DA_DIVE;
			RestartMainSequence();
			iGestureActivity = ACT_VM_IDLE;
		}
		break;

	case PLAYERANIMEVENT_DIVE_TO_ROLL:
		{
			m_bRollTransition = true;
			m_bRollTransitionFirstFrame = true;
			m_iRollActivity = ACT_DA_DIVEROLL;
			RestartMainSequence();
			iGestureActivity = ACT_VM_IDLE; //Clear for weapon, we have no stand->slide so just idle.
		}
		break;

	case PLAYERANIMEVENT_STAND_TO_SLIDE:
		{
			m_bSlideTransition = true;
			m_bSlideTransitionFirstFrame = true;
			m_iSlideActivity = ACT_DA_SLIDESTART;
			RestartMainSequence();
			iGestureActivity = ACT_VM_IDLE; //Clear for weapon, we have no stand->slide so just idle.
		}
		break;

	case PLAYERANIMEVENT_STAND_TO_ROLL:
		{
			m_bRollTransition = true;
			m_bRollTransitionFirstFrame = true;
			m_iRollActivity = ACT_DA_ROLL;
			RestartMainSequence();
			iGestureActivity = ACT_VM_IDLE; //Clear for weapon, we have no stand->slide so just idle.
		}
		break;

	case PLAYERANIMEVENT_STAND_TO_VAULT:
		m_bRollTransition = true;
		m_bRollTransitionFirstFrame = true;
		m_iRollActivity = ACT_DA_ROLL;
		RestartMainSequence();
		iGestureActivity = ACT_VM_IDLE;
		break;
	case PLAYERANIMEVENT_STAND_TO_WALLRUN:
		m_bRollTransition = true;
		m_bRollTransitionFirstFrame = true;
		m_iRollActivity = ACT_DA_ROLL;
		RestartMainSequence();
		iGestureActivity = ACT_VM_IDLE;
		break;
	case PLAYERANIMEVENT_WALLFLIP:
		RestartMainSequence();
		iGestureActivity = ACT_VM_IDLE;
		break;
	case PLAYERANIMEVENT_WALLCLIMB:
		RestartMainSequence();
		iGestureActivity = ACT_VM_IDLE;
		break;
	case PLAYERANIMEVENT_JUMP:
		{
			// Jump.
			m_bJumping = true;
			m_bFirstJumpFrame = true;
			m_flJumpStartTime = m_pSDKPlayer->GetCurrentTime();

			RestartMainSequence();

			break;
		}

	case PLAYERANIMEVENT_CANCEL:
		{
			ResetGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD );
			break;
		}

	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
}
开发者ID:jlwitthuhn,项目名称:DoubleAction,代码行数:101,代码来源:sdk_playeranimstate.cpp

示例2: DoAnimationEvent


//.........这里部分代码省略.........
			else if ( GetBasePlayer()->GetFlags() & FL_DUCKING ) 
			{
				// Weapon post-fire. Used for minigun winddown in crouch.
				iGestureActivity = ACT_MP_ATTACK_CROUCH_POSTFIRE;
			}
			else
			{
				// Weapon post-fire. Used for minigun winddown.
				iGestureActivity = ACT_MP_ATTACK_STAND_POSTFIRE;
			}

			RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, iGestureActivity );

			break;
		}

	case PLAYERANIMEVENT_RELOAD:
		{
			// Weapon reload.
			if ( m_bInAirWalk )
			{
				RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_AIRWALK );
			}
			else
			{
				BaseClass::DoAnimationEvent( event, nData );
			}
			break;
		}
	case PLAYERANIMEVENT_RELOAD_LOOP:
		{
			// Weapon reload.
			if ( m_bInAirWalk )
			{
				RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_AIRWALK_LOOP );
			}
			else
			{
				BaseClass::DoAnimationEvent( event, nData );
			}
			break;
		}
	case PLAYERANIMEVENT_RELOAD_END:
		{
			// Weapon reload.
			if ( m_bInAirWalk )
			{
				RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_AIRWALK_END );
			}
			else
			{
				BaseClass::DoAnimationEvent( event, nData );
			}
			break;
		}
	case PLAYERANIMEVENT_DOUBLEJUMP:
		{
			// Check to see if we are jumping!
			if ( !m_bJumping )
			{
				m_bJumping = true;
				m_bFirstJumpFrame = true;
				m_flJumpStartTime = gpGlobals->curtime;
				RestartMainSequence();
			}

			// Force the air walk off.
			m_bInAirWalk = false;

			// Player the air dash gesture.
			if (GetBasePlayer()->GetFlags() & FL_DUCKING)
			{
				RestartGesture( GESTURE_SLOT_JUMP, ACT_MP_DOUBLEJUMP_CROUCH );
			}
			else
			{
				RestartGesture( GESTURE_SLOT_JUMP, ACT_MP_DOUBLEJUMP );
			}
			break;
		}
	default:
		{
			BaseClass::DoAnimationEvent( event, nData );
			break;
		}
	}

#ifdef CLIENT_DLL
	// Make the weapon play the animation as well
	if (iGestureActivity != ACT_INVALID && GetBasePlayer() != C_BasePlayer::GetLocalPlayer())
	{
		CBaseCombatWeapon *pWeapon = GetTFPlayer()->GetActiveWeapon();
		if ( pWeapon )
		{
			pWeapon->SendWeaponAnim( iGestureActivity );
			pWeapon->DoAnimationEvents(pWeapon->GetModelPtr());
		}
	}
#endif
}
开发者ID:TenmaPL,项目名称:TF2Classic,代码行数:101,代码来源:tf_playeranimstate.cpp

示例3:


//.........这里部分代码省略.........
			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
}
开发者ID:hekar,项目名称:luminousforts-codebase,代码行数:101,代码来源:hl2mp_playeranimstate.cpp

示例4: 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
}
开发者ID:DeadFuze,项目名称:swarm-sdk,代码行数:101,代码来源:sdk_playeranimstate.cpp


注:本文中的CBaseCombatWeapon::DoAnimationEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。