本文整理汇总了C++中EHANDLE::GetAbsAngles方法的典型用法代码示例。如果您正苦于以下问题:C++ EHANDLE::GetAbsAngles方法的具体用法?C++ EHANDLE::GetAbsAngles怎么用?C++ EHANDLE::GetAbsAngles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EHANDLE
的用法示例。
在下文中一共展示了EHANDLE::GetAbsAngles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawDebugLines
//-----------------------------------------------------------------------------
// Purpose: Draws magic lines...
//-----------------------------------------------------------------------------
void CPointAngularVelocitySensor::DrawDebugLines( void )
{
if ( m_hTargetEntity )
{
Vector vForward, vRight, vUp;
AngleVectors( m_hTargetEntity->GetAbsAngles(), &vForward, &vRight, &vUp );
NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() + vForward * 64, 255, 0, 0, false, 0 );
NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() + vRight * 64, 0, 255, 0, false, 0 );
NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() + vUp * 64, 0, 0, 255, false, 0 );
}
if ( m_bUseHelper == true )
{
QAngle Angles;
Vector vAxisForward, vAxisRight, vAxisUp;
Vector vLine = m_vecAxis - GetAbsOrigin();
VectorNormalize( vLine );
VectorAngles( vLine, Angles );
AngleVectors( Angles, &vAxisForward, &vAxisRight, &vAxisUp );
NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() + vAxisForward * 64, 255, 0, 0, false, 0 );
NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() + vAxisRight * 64, 0, 255, 0, false, 0 );
NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() + vAxisUp * 64, 0, 0, 255, false, 0 );
}
}
示例2: FinishCommentary
//------------------------------------------------------------------------------
// Purpose:
//------------------------------------------------------------------------------
void CPointCommentaryNode::FinishCommentary( bool bBlendOut )
{
CBasePlayer *pPlayer = GetCommentaryPlayer();
if ( !pPlayer )
return;
// Fire off our postcommands
if ( m_iszPostCommands != NULL_STRING )
{
g_CommentarySystem.SetCommentaryConvarsChanging( true );
engine->ClientCommand( pPlayer->edict(), STRING(m_iszPostCommands) );
engine->ClientCommand( pPlayer->edict(), "commentary_cvarsnotchanging\n" );
}
// Stop the commentary
m_flFinishedTime = gpGlobals->curtime;
if ( bBlendOut && m_hViewPositionMover )
{
m_bActive = false;
m_flPlaybackRate = 1.0;
m_vecFinishOrigin = m_hViewPositionMover->GetAbsOrigin();
m_vecFinishAngles = m_hViewPositionMover->GetAbsAngles();
m_bPreventChangesWhileMoving = true;
// We've moved away from the player's position. Move back to it before ending
SetContextThink( &CPointCommentaryNode::UpdateViewPostThink, gpGlobals->curtime, s_pCommentaryUpdateViewThink );
return;
}
CleanupPostCommentary();
}
示例3: ClientThink
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_ScriptIntro::ClientThink( void )
{
Assert( m_IntroData.m_Passes.Count() <= 2 );
if ( m_hCameraEntity )
{
m_IntroData.m_vecCameraView = m_hCameraEntity->GetAbsOrigin();
m_IntroData.m_vecCameraViewAngles = m_hCameraEntity->GetAbsAngles();
}
CalculateFOV();
CalculateAlpha();
// Calculate the blend levels of each pass
float flPerc = 1.0;
if ( (m_flNextBlendTime - m_flBlendStartTime) != 0 )
{
flPerc = clamp( (gpGlobals->curtime - m_flBlendStartTime) / (m_flNextBlendTime - m_flBlendStartTime), 0, 1 );
}
// Detect when we're finished blending
if ( flPerc >= 1.0 )
{
if ( m_IntroData.m_Passes.Count() == 2 )
{
// We're done blending
m_IntroData.m_Passes[0].m_BlendMode = m_IntroData.m_Passes[1].m_BlendMode;
m_IntroData.m_Passes[0].m_Alpha = 1.0;
m_IntroData.m_Passes.Remove(1);
//Msg("FINISHED BLEND.\n");
}
return;
}
/*
if ( m_flNextBlendTime >= gpGlobals->curtime )
{
Msg("INTRO BLENDING: Blending from mode %d to %d.\n", m_IntroData.m_Passes[0].m_BlendMode, m_IntroData.m_Passes[1].m_BlendMode );
Msg(" curtime %.2f StartedAt %.2f FinishAt: %.2f\n", gpGlobals->curtime, m_flBlendStartTime, m_flNextBlendTime );
Msg(" Perc: %.2f\n", flPerc );
}
*/
if ( m_IntroData.m_Passes.Count() == 2 )
{
m_IntroData.m_Passes[0].m_Alpha = 1.0 - flPerc;
m_IntroData.m_Passes[1].m_Alpha = flPerc;
}
else
{
m_IntroData.m_Passes[0].m_Alpha = 1.0 - flPerc;
}
}
示例4: UpdateViewPostThink
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPointCommentaryNode::UpdateViewPostThink( void )
{
CBasePlayer *pPlayer = GetCommentaryPlayer();
if ( !pPlayer )
return;
if ( m_hViewPosition.Get() && m_hViewPositionMover )
{
// Blend back to the player's position over time.
float flCurTime = (gpGlobals->curtime - m_flFinishedTime);
float flTimeToBlend = min( 2.0, m_flFinishedTime - m_flStartTime );
float flBlendPerc = 1.0 - clamp( flCurTime / flTimeToBlend, 0, 1 );
//Msg("OUT: CurTime %.2f, BlendTime: %.2f, Blend: %.3f\n", flCurTime, flTimeToBlend, flBlendPerc );
// Only do this while we're still moving
if ( flBlendPerc > 0 )
{
// Figure out the current view position
Vector vecPlayerPos = pPlayer->EyePosition();
Vector vecToPosition = (m_vecFinishOrigin - vecPlayerPos);
Vector vecCurEye = pPlayer->EyePosition() + (vecToPosition * flBlendPerc);
m_hViewPositionMover->SetAbsOrigin( vecCurEye );
if ( m_hViewTarget )
{
Quaternion quatFinish;
Quaternion quatOriginal;
Quaternion quatCurrent;
AngleQuaternion( m_vecOriginalAngles, quatOriginal );
AngleQuaternion( m_vecFinishAngles, quatFinish );
QuaternionSlerp( quatFinish, quatOriginal, 1.0 - flBlendPerc, quatCurrent );
QAngle angCurrent;
QuaternionAngles( quatCurrent, angCurrent );
m_hViewPositionMover->SetAbsAngles( angCurrent );
}
SetNextThink( gpGlobals->curtime, s_pCommentaryUpdateViewThink );
return;
}
pPlayer->SnapEyeAngles( m_hViewPositionMover->GetAbsAngles() );
}
// We're done
CleanupPostCommentary();
m_bPreventChangesWhileMoving = false;
}
示例5: UpdateViewThink
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPointCommentaryNode::UpdateViewThink( void )
{
if ( !m_bActive )
return;
CBasePlayer *pPlayer = GetCommentaryPlayer();
if ( !pPlayer )
return;
// Swing the view towards the target
if ( m_hViewTarget )
{
QAngle angGoal;
QAngle angCurrent;
if ( m_hViewPositionMover )
{
angCurrent = m_hViewPositionMover->GetAbsAngles();
VectorAngles( m_hViewTarget->WorldSpaceCenter() - m_hViewPositionMover->GetAbsOrigin(), angGoal );
}
else
{
angCurrent = pPlayer->EyeAngles();
VectorAngles( m_hViewTarget->WorldSpaceCenter() - pPlayer->EyePosition(), angGoal );
}
// Accelerate towards the target goal angles
float dx = AngleDiff( angGoal.x, angCurrent.x );
float dy = AngleDiff( angGoal.y, angCurrent.y );
float mod = 1.0 - ExponentialDecay( 0.5, 0.3, gpGlobals->frametime );
float dxmod = dx * mod;
float dymod = dy * mod;
angCurrent.x = AngleNormalize( angCurrent.x + dxmod );
angCurrent.y = AngleNormalize( angCurrent.y + dymod );
if ( m_hViewPositionMover )
{
m_hViewPositionMover->SetAbsAngles( angCurrent );
}
else
{
pPlayer->SnapEyeAngles( angCurrent );
}
SetNextThink( gpGlobals->curtime, s_pCommentaryUpdateViewThink );
}
if ( m_hViewPosition.Get() )
{
if ( pPlayer->GetActiveWeapon() )
{
pPlayer->GetActiveWeapon()->Holster();
}
if ( !m_hViewPositionMover )
{
// Make an invisible info target entity for us to attach the view to,
// and move it to the desired view position.
m_hViewPositionMover = CreateEntityByName( "env_laserdot" );
m_hViewPositionMover->SetAbsAngles( pPlayer->EyeAngles() );
pPlayer->SetViewEntity( m_hViewPositionMover );
}
// Blend to the target position over time.
float flCurTime = (gpGlobals->curtime - m_flStartTime);
float flBlendPerc = clamp( flCurTime / 2.0, 0, 1 );
// Figure out the current view position
Vector vecCurEye;
VectorLerp( pPlayer->EyePosition(), m_hViewPosition.Get()->GetAbsOrigin(), flBlendPerc, vecCurEye );
m_hViewPositionMover->SetAbsOrigin( vecCurEye );
SetNextThink( gpGlobals->curtime, s_pCommentaryUpdateViewThink );
}
}