• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ EyeAngles函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中EyeAngles函数的典型用法代码示例。如果您正苦于以下问题:C++ EyeAngles函数的具体用法?C++ EyeAngles怎么用?C++ EyeAngles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: GetAbsOrigin

void C_CFPlayer::UpdateClientSideAnimation()
{
	// Update the animation data. It does the local check here so this works when using
	// a third-person camera (and we don't have valid player angles).
	if ( this == C_CFPlayer::GetLocalCFPlayer() )
	{
		if (m_hReviving != NULL || m_hReviver != NULL)
		{
			C_CFPlayer* pTarget = m_hReviving;
			if (!pTarget)
				pTarget = m_hReviver;

			// Snap the animation to face the model during fatalities.
			Vector vecToTarget = pTarget->GetAbsOrigin() - GetAbsOrigin();
			QAngle angToTarget;
			VectorAngles(vecToTarget, angToTarget);

			m_PlayerAnimState->Update( angToTarget[YAW], angToTarget[PITCH] );
		}
		else
			m_PlayerAnimState->Update( EyeAngles()[YAW], EyeAngles()[PITCH] );
	}
	else
		m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );

	BaseClass::UpdateClientSideAnimation();
}
开发者ID:BSVino,项目名称:Arcon,代码行数:27,代码来源:c_cf_player.cpp


示例2: defined

void CBasePlayer::CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov )
{
#if defined( CLIENT_DLL )
	if ( !prediction->InPrediction() )
	{
		// FIXME: Move into prediction
		view->DriftPitch();
	}
#endif

	VectorCopy( EyePosition(), eyeOrigin );
#ifdef SIXENSE
	if ( g_pSixenseInput->IsEnabled() )
	{
		VectorCopy( EyeAngles() + GetEyeAngleOffset(), eyeAngles );
	}
	else
	{
		VectorCopy( EyeAngles(), eyeAngles );
	}
#else
	VectorCopy( EyeAngles(), eyeAngles );
#endif

#if defined( CLIENT_DLL )
	if ( !prediction->InPrediction() )
#endif
	{
		SmoothViewOnStairs( eyeOrigin );
	}

	// Snack off the origin before bob + water offset are applied
	Vector vecBaseEyePosition = eyeOrigin;

	CalcViewRoll( eyeAngles );

	// Apply punch angle
	VectorAdd( eyeAngles, m_Local.m_vecPunchAngle, eyeAngles );

#if defined( CLIENT_DLL )
	if ( !prediction->InPrediction() )
	{
		// Shake it up baby!
		vieweffects->CalcShake();
		vieweffects->ApplyShake( eyeOrigin, eyeAngles, 1.0 );
	}
#endif

#if defined( CLIENT_DLL )
	// Apply a smoothing offset to smooth out prediction errors.
	Vector vSmoothOffset;
	GetPredictionErrorSmoothingVector( vSmoothOffset );
	eyeOrigin += vSmoothOffset;
	m_flObserverChaseDistance = 0.0;
#endif

	// calc current FOV
	fov = GetFOV();
}
开发者ID:EspyEspurr,项目名称:game,代码行数:59,代码来源:baseplayer_shared.cpp


示例3: GetLocalAngles

void C_MSS_Player::PreThink( void )
{
	QAngle vTempAngles = GetLocalAngles();

	if ( GetLocalPlayer() == this )
	{
		vTempAngles[PITCH] = EyeAngles()[PITCH];
	}
	else
	{
		vTempAngles[PITCH] = m_angEyeAngles[PITCH];
	}

	if ( vTempAngles[YAW] < 0.0f )
	{
		vTempAngles[YAW] += 360.0f;
	}

	SetLocalAngles( vTempAngles );

	BaseClass::PreThink();

	HandleSpeedChanges();

	if ( m_HL2Local.m_flSuitPower <= 0.0f )
	{
		if( IsSprinting() )
		{
			StopSprinting();
		}
	}
}
开发者ID:BoXorz,项目名称:MSS,代码行数:32,代码来源:c_MSS_player.cpp


示例4: GetVehicle

//-----------------------------------------------------------------------------
// Purpose: Returns the eye position and angle vectors.
//-----------------------------------------------------------------------------
void CBasePlayer::EyePositionAndVectors( Vector *pPosition, Vector *pForward,
										 Vector *pRight, Vector *pUp )
{
#ifdef CLIENT_DLL
	IClientVehicle *pVehicle = GetVehicle();
#else
	IServerVehicle *pVehicle = GetVehicle();
#endif

	if ( pVehicle )
	{
		Assert( pVehicle );

		int nRole = pVehicle->GetPassengerRole( this );

		Vector vecEyeOrigin;
		QAngle angEyeAngles;
		pVehicle->GetVehicleViewPosition( nRole, pPosition, &angEyeAngles );
		AngleVectors( angEyeAngles, pForward, pRight, pUp );
	}
	else
	{
		VectorCopy( BaseClass::EyePosition(), *pPosition );
		AngleVectors( EyeAngles(), pForward, pRight, pUp );
	}
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:29,代码来源:baseplayer_shared.cpp


示例5: IsLocalPlayer

void C_SDKPlayer::LookAtBall(void)
{
	const QAngle camAngles = IsLocalPlayer() ? ::input->GetCameraAngles() : m_angCamViewAngles;
	float yaw = camAngles[YAW] - EyeAngles()[YAW];
	float pitch = camAngles[PITCH];

	if (yaw > 180) yaw -= 360;
	if (yaw < -180) yaw += 360;
	if (pitch > 180) pitch -= 360;
	if (pitch < -180) pitch += 360;

	//if (yaw > 90) yaw = 180 - yaw;
	//if (yaw < -90) yaw = -180 - yaw;

	pitch = clamp(pitch, -60, 60);
	yaw = clamp(yaw, -120, 120);

	float neckVal = clamp(yaw, -50, 50);
	SetBoneController(2, neckVal); // Neck
	yaw -= neckVal;

	float upperSpineVal = clamp(yaw, -40, 40);
	SetBoneController(1, upperSpineVal); // Upper spine
	yaw -= upperSpineVal;

	float lowerSpineVal = clamp(yaw, -30, 30);
	SetBoneController(0, lowerSpineVal); // Lower spine

	SetBoneController(3, pitch);
}
开发者ID:iosoccer,项目名称:iosoccer-game,代码行数:30,代码来源:c_sdk_player.cpp


示例6: AngleVectors

//=========================================================
// Autoaim
// set crosshair position to point to enemey
//=========================================================
Vector C_HL2MP_Player::GetAutoaimVector( float flDelta )
{
	// Never autoaim a predicted weapon (for now)
	Vector	forward;
	AngleVectors( EyeAngles() + m_Local.m_vecPunchAngle, &forward );
	return	forward;
}
开发者ID:uunx,项目名称:quakelife2,代码行数:11,代码来源:c_hl2mp_player.cpp


示例7: EyeAngles

void C_MSS_Player::PostThink( void )
{
	BaseClass::PostThink();

	// Store the eye angles pitch so the client can compute its animation state correctly.
	m_angEyeAngles = EyeAngles();
}
开发者ID:BoXorz,项目名称:MSS,代码行数:7,代码来源:c_MSS_player.cpp


示例8: ToCFPlayer

void C_CFPlayer::CalcInEyeCamView(Vector& eyeOrigin, QAngle& eyeAngles, float& fov)
{
	C_CFPlayer *pTarget = ToCFPlayer(GetObserverTarget());

	if ( !pTarget ) 
	{
		// just copy a save in-map position
		VectorCopy( EyePosition(), eyeOrigin );
		VectorCopy( EyeAngles(), eyeAngles );
		return;
	};

	if ( pTarget->ShouldForceThirdPerson() )
	{
		CalcChaseCamView( eyeOrigin, eyeAngles, fov );
		return;
	}

	fov = GetFOV();	// TODO use tragets FOV

	m_flObserverChaseDistance = 0.0;

	eyeAngles = pTarget->EyeAngles();
	eyeOrigin = pTarget->EyePosition();

	// Apply punch angle
	VectorAdd( eyeAngles, GetPunchAngle(), eyeAngles );

	engine->SetViewAngles( eyeAngles );
}
开发者ID:BSVino,项目名称:Arcon,代码行数:30,代码来源:c_cf_player.cpp


示例9: ToBasePlayer

/**
	Returns true if we are looking towards something within a tolerence determined 
	by our field of view
*/
bool CBaseCombatCharacter::IsInFieldOfView( CBaseEntity *entity ) const
{
	CBasePlayer *pPlayer = ToBasePlayer( const_cast< CBaseCombatCharacter* >( this ) );
	float flTolerance = pPlayer ? cos( (float)pPlayer->GetFOV() * 0.5f ) : BCC_DEFAULT_LOOK_TOWARDS_TOLERANCE;

	Vector vecForward;
	Vector vecEyePosition = EyePosition();
	AngleVectors( EyeAngles(), &vecForward );

	// FIXME: Use a faster check than this!

	// Check 3 spots, or else when standing right next to someone looking at their eyes, 
	// the angle will be too great to see their center.
	Vector vecToTarget = entity->GetAbsOrigin() - vecEyePosition;
	vecToTarget.NormalizeInPlace();
	if ( DotProduct( vecForward, vecToTarget ) >= flTolerance )
		return true;

	vecToTarget = entity->WorldSpaceCenter() - vecEyePosition;
	vecToTarget.NormalizeInPlace();
	if ( DotProduct( vecForward, vecToTarget ) >= flTolerance )
		return true;

	vecToTarget = entity->EyePosition() - vecEyePosition;
	vecToTarget.NormalizeInPlace();
	return ( DotProduct( vecForward, vecToTarget ) >= flTolerance );
}
开发者ID:EspyEspurr,项目名称:game,代码行数:31,代码来源:basecombatcharacter_shared.cpp


示例10: SetCollisionBounds

void CHL2MP_Player::PostThink( void )
{
	BaseClass::PostThink();
	
	if ( GetFlags() & FL_DUCKING )
	{
		SetCollisionBounds( VEC_CROUCH_TRACE_MIN, VEC_CROUCH_TRACE_MAX );
	}

	m_PlayerAnimState.Update();

	// Store the eye angles pitch so the client can compute its animation state correctly.
	m_angEyeAngles = EyeAngles();

	QAngle angles = GetLocalAngles();
	angles[PITCH] = 0;
	SetLocalAngles( angles );

	if (!IsDead())
	{
		if (m_afButtonReleased & IN_KICK && m_flNextKickAttack < gpGlobals->curtime /* && m_flNextKickAttack < gpGlobals->curtime  && !m_bIsKicking*/)
		{
			KickAttack();
			m_bIsKicking = true;
		}
	}

	CBaseCombatWeapon *pWeapon = this->GetActiveWeapon();
	if (pWeapon != NULL)
	{
		if (m_afButtonPressed & IN_IRONSIGHT)
		{
			pWeapon->EnableIronsights();
		}
		else if (m_afButtonReleased & IN_IRONSIGHT)
		{
			pWeapon->DisableIronsights();
		}
	}

	if (!IsDead())
	{
		if (m_flNextKickAttack < gpGlobals->curtime)
		{
			m_bIsKicking = false;
			CBaseViewModel *vm = GetViewModel(1);

			if (vm)
			{
				int	idealSequence = vm->SelectWeightedSequence(ACT_VM_IDLE);

				if (idealSequence >= 0)
				{
					vm->SendViewModelMatchingSequence(idealSequence);
				}
			}
		}
	}
}
开发者ID:RaraFolf,项目名称:FIREFIGHT-RELOADED-src-sdk-2013,代码行数:59,代码来源:hl2mp_player.cpp


示例11: EyePosition

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : eyeOrigin - 
//			eyeAngles - 
//			zNear - 
//			zFar - 
//			fov - 
//-----------------------------------------------------------------------------
void CBasePlayer::CalcView( Vector &eyeOrigin, QAngle &eyeAngles, float &zNear, float &zFar, float &fov )
{
	eyeOrigin = EyePosition();
	eyeAngles = EyeAngles();

#if defined( CLIENT_DLL )
	Camera()->CalcView(eyeOrigin, eyeAngles, fov);
#endif
}
开发者ID:iosoccer,项目名称:iosoccer-game,代码行数:17,代码来源:baseplayer_shared.cpp


示例12: EyeAngles

void C_NEOPlayer::UpdateClientSideAnimation()
{
	if ( this == GetLocalNEOPlayer() )
		m_PlayerAnimState->Update( EyeAngles()[ YAW ], m_angEyeAngles[ PITCH ] );
	else
		m_PlayerAnimState->Update( m_angEyeAngles[ YAW ], m_angEyeAngles[ PITCH ] );

	C_BaseAnimating::UpdateClientSideAnimation();
}
开发者ID:Ochii,项目名称:nt-revamp,代码行数:9,代码来源:c_neoplayer.cpp


示例13: EyePosition

/**
	Return true if our view direction is pointing at the given target, 
	within the cosine of the angular tolerance. LINE OF SIGHT IS NOT CHECKED.
*/
bool CBaseCombatCharacter::IsLookingTowards( const Vector &target, float cosTolerance ) const
{
	Vector toTarget = target - EyePosition();
	toTarget.NormalizeInPlace();

	Vector forward;
	AngleVectors( EyeAngles(), &forward );

	return ( DotProduct( forward, toTarget ) >= cosTolerance );
}
开发者ID:EspyEspurr,项目名称:game,代码行数:14,代码来源:basecombatcharacter_shared.cpp


示例14: EyeAngles

void C_SDKPlayer::UpdateClientSideAnimation()
{
	// Update the animation data. It does the local check here so this works when using
	// a third-person camera (and we don't have valid player angles).
	if ( this == C_SDKPlayer::GetLocalSDKPlayer() )
		m_PlayerAnimState->Update( EyeAngles()[YAW], m_angEyeAngles[PITCH] );
	else
		m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );

	BaseClass::UpdateClientSideAnimation();
}
开发者ID:Epic-xx,项目名称:impending,代码行数:11,代码来源:c_sdk_player.cpp


示例15: DETOUR_DECL_MEMBER

	/* CTFBotMvMEngineerIdle::Update static_cast's the owner of the sentry hint
	 * to a CObjectSentrygun and calls GetTurretAngles, which doesn't exist for
	 * CObjectDispenser; this tweak should avoid the problem */
	DETOUR_DECL_MEMBER(const QAngle&, CObjectDispenser_GetAvailableMetal)
	{
		TRACE();
		
		if (rc_CTFBotMvMEngineerIdle_Update > 0) {
			TRACE_MSG("in CTFBotMvMEngineerIdle::Update");
			auto obj = reinterpret_cast<CBaseEntity *>(this);
			return obj->EyeAngles();
		}
		
		return DETOUR_MEMBER_CALL(CObjectDispenser_GetAvailableMetal)();
	}
开发者ID:sigsegv-mvm,项目名称:sigsegv-mvm,代码行数:15,代码来源:engiebot_dispensers.cpp


示例16: CHL2MPFlashlightEffect

//-----------------------------------------------------------------------------
// Purpose: Creates, destroys, and updates the flashlight effect as needed.
//-----------------------------------------------------------------------------
void C_HL2MP_Player::UpdateFlashlight()
{
	// The dim light is the flashlight.
	if ( IsEffectActive( EF_DIMLIGHT ) )
	{
		if (!m_pHL2MPFlashLightEffect)
		{
			// Turned on the headlight; create it.
			m_pHL2MPFlashLightEffect = new CHL2MPFlashlightEffect(index);

			if (!m_pHL2MPFlashLightEffect)
				return;

			m_pHL2MPFlashLightEffect->TurnOn();
		}

		Vector vecForward, vecRight, vecUp;
		Vector position = EyePosition();

		if ( ::input->CAM_IsThirdPerson() )
		{
			int iAttachment = LookupAttachment( "anim_attachment_RH" );

			if ( iAttachment >= 0 )
			{
				Vector vecOrigin;
				//Tony; EyeAngles will return proper whether it's local player or not.
				QAngle eyeAngles = EyeAngles();

				GetAttachment( iAttachment, vecOrigin, eyeAngles );

				Vector vForward;
				AngleVectors( eyeAngles, &vecForward, &vecRight, &vecUp );
				position = vecOrigin;
			}
			else
				EyeVectors( &vecForward, &vecRight, &vecUp );
		}
		else
			EyeVectors( &vecForward, &vecRight, &vecUp );


		// Update the light with the new position and direction.		
		m_pHL2MPFlashLightEffect->UpdateLight( position, vecForward, vecRight, vecUp, FLASHLIGHT_DISTANCE );
	}
	else if (m_pHL2MPFlashLightEffect)
	{
		// Turned off the flashlight; delete it.
		delete m_pHL2MPFlashLightEffect;
		m_pHL2MPFlashLightEffect = NULL;
	}
}
开发者ID:uunx,项目名称:quakelife2,代码行数:55,代码来源:c_hl2mp_player.cpp


示例17: GetLocalAngles

void CSDKPlayer::PostThink()
{
	BaseClass::PostThink();

	QAngle angles = GetLocalAngles();
	angles[PITCH] = 0;
	SetLocalAngles( angles );
	
	// Store the eye angles pitch so the client can compute its animation state correctly.
	m_angEyeAngles = EyeAngles();

    m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:13,代码来源:sdk_player.cpp


示例18: GetLocalAngles

void CBaseNetworkedPlayer::PostThink()
{
	BaseClass::PostThink();

	// Keep the model upright; pose params will handle pitch aiming.
	QAngle angles = GetLocalAngles();
	angles[PITCH] = 0;
	SetLocalAngles(angles);

	m_angEyeAngles = EyeAngles();

	m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
}
开发者ID:DonnaLisa,项目名称:swarm-deferred,代码行数:13,代码来源:basenetworkedplayer.cpp


示例19: SetCollisionBounds

void CHL2MP_Player::PostThink( void )
{
	BaseClass::PostThink();
	
	if ( GetFlags() & FL_DUCKING )
		SetCollisionBounds( VEC_CROUCH_TRACE_MIN, VEC_CROUCH_TRACE_MAX );

	QAngle angles = GetLocalAngles();
	angles[PITCH] = 0;
	SetLocalAngles( angles );

	// Store the eye angles pitch so the client can compute its animation state correctly.
	m_angEyeAngles = EyeAngles();
	m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
}
开发者ID:Orygin,项目名称:BisounoursParty,代码行数:15,代码来源:hl2mp_player.cpp


示例20: VPROF

//-----------------------------------------------------------------------------
// Purpose: Called every usercmd by the player PostThink
//-----------------------------------------------------------------------------
void CBasePlayer::ItemPostFrame()
{
	VPROF( "CBasePlayer::ItemPostFrame" );

	// Put viewmodels into basically correct place based on new player origin
	CalcViewModelView( EyePosition(), EyeAngles() );

	// check if the player is using something
	if ( m_hUseEntity != NULL )
	{
#if !defined( CLIENT_DLL )
		ImpulseCommands();// this will call playerUse
#endif
		return;
	}

    if ( gpGlobals->curtime < m_flNextAttack )
	{
		if ( GetActiveWeapon() )
		{
			GetActiveWeapon()->ItemBusyFrame();
		}
	}
	else
	{
		if ( GetActiveWeapon() )
		{
#if defined( CLIENT_DLL )
			// Not predicting this weapon
			if ( GetActiveWeapon()->IsPredicted() )
#endif

			{
				GetActiveWeapon()->ItemPostFrame( );
			}
		}
	}

#if !defined( CLIENT_DLL )
	ImpulseCommands();
#else
	// NOTE: If we ever support full impulse commands on the client,
	// remove this line and call ImpulseCommands instead.
	m_nImpulse = 0;
#endif
}
开发者ID:EspyEspurr,项目名称:game,代码行数:49,代码来源:baseplayer_shared.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ EyePosition函数代码示例发布时间:2022-05-30
下一篇:
C++ ExtractFileName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap