本文整理汇总了C++中CBaseEntity::GetLocalAngles方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntity::GetLocalAngles方法的具体用法?C++ CBaseEntity::GetLocalAngles怎么用?C++ CBaseEntity::GetLocalAngles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseEntity
的用法示例。
在下文中一共展示了CBaseEntity::GetLocalAngles方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Vector
//=========================================================
//=========================================================
CBaseEntity *CGameRules::GetPlayerSpawnSpot( CBasePlayer *pPlayer )
{
CBaseEntity *pSpawnSpot = pPlayer->EntSelectSpawnPoint();
Assert( pSpawnSpot );
pPlayer->SetLocalOrigin( pSpawnSpot->GetAbsOrigin() + Vector(0,0,1) );
pPlayer->SetAbsVelocity( vec3_origin );
pPlayer->SetLocalAngles( pSpawnSpot->GetLocalAngles() );
pPlayer->m_Local.m_vecPunchAngle = vec3_angle;
pPlayer->m_Local.m_vecPunchAngleVel = vec3_angle;
pPlayer->SnapEyeAngles( pSpawnSpot->GetLocalAngles() );
return pSpawnSpot;
}
示例2: TestSpawnPointType
void TestSpawnPointType( const char *pEntClassName )
{
// Find the next spawn spot.
CBaseEntity *pSpot = gEntList.FindEntityByClassname( NULL, pEntClassName );
while( pSpot )
{
// check if pSpot is valid
if( g_pGameRules->IsSpawnPointValid( pSpot, NULL ) )
{
// the successful spawn point's location
NDebugOverlay::Box( pSpot->GetAbsOrigin(), VEC_HULL_MIN, VEC_HULL_MAX, 0, 255, 0, 100, 60 );
// drop down to ground
Vector GroundPos = DropToGround( NULL, pSpot->GetAbsOrigin(), VEC_HULL_MIN, VEC_HULL_MAX );
// the location the player will spawn at
NDebugOverlay::Box( GroundPos, VEC_HULL_MIN, VEC_HULL_MAX, 0, 0, 255, 100, 60 );
// draw the spawn angles
QAngle spotAngles = pSpot->GetLocalAngles();
Vector vecForward;
AngleVectors( spotAngles, &vecForward );
NDebugOverlay::HorzArrow( pSpot->GetAbsOrigin(), pSpot->GetAbsOrigin() + vecForward * 32, 10, 255, 0, 0, 255, true, 60 );
}
else
{
// failed spawn point location
NDebugOverlay::Box( pSpot->GetAbsOrigin(), VEC_HULL_MIN, VEC_HULL_MAX, 255, 0, 0, 100, 60 );
}
// increment pSpot
pSpot = gEntList.FindEntityByClassname( pSpot, pEntClassName );
}
}
示例3: CalcFollowPosition
bool CAI_FollowManager::CalcFollowPosition( AI_FollowManagerInfoHandle_t hInfo, AI_FollowNavInfo_t *pNavInfo )
{
FollowerListIter_t iterNode = *((FollowerListIter_t *)(&hInfo));
if ( hInfo && iterNode->pGroup )
{
Assert( iterNode->pGroup->hFollowTarget.Get() );
CBaseEntity *pTarget = iterNode->pGroup->hFollowTarget;
if ( iterNode->navInfo.position != vec3_origin )
{
QAngle angles = pTarget->GetLocalAngles();
angles.x = angles.z = 0;
matrix3x4_t fRotateMatrix;
AngleMatrix(angles, fRotateMatrix);
VectorRotate( iterNode->navInfo.position, fRotateMatrix, pNavInfo->position);
pNavInfo->position += pTarget->WorldSpaceCenter();
}
else
{
pNavInfo->position = iterNode->navInfo.position + pTarget->WorldSpaceCenter();
}
pNavInfo->tolerance = iterNode->navInfo.tolerance;
pNavInfo->range = iterNode->navInfo.range;
pNavInfo->followPointTolerance = iterNode->pGroup->pFormation->followPointTolerance;
return true;
}
return false;
}
示例4: Vector
//=========================================================
//=========================================================
CBaseEntity *CGameRules::GetPlayerSpawnSpot( CBasePlayer *pPlayer )
{
CBaseEntity *pSpawnSpot = pPlayer->EntSelectSpawnPoint();
Assert( pSpawnSpot );
//BG2 - Tjoppen - don't do squat in GetPlayerSpawnSpot if we get NULL.. we might be a spectator or something
if( !pSpawnSpot )
return NULL;
//
pPlayer->SetLocalOrigin( pSpawnSpot->GetAbsOrigin() + Vector(0,0,1) );
pPlayer->SetAbsVelocity( vec3_origin );
pPlayer->SetLocalAngles( pSpawnSpot->GetLocalAngles() );
pPlayer->m_Local.m_vecPunchAngle = vec3_angle;
pPlayer->m_Local.m_vecPunchAngleVel = vec3_angle;
pPlayer->SnapEyeAngles( pSpawnSpot->GetLocalAngles() );
CSpawnPoint *pSpawn = static_cast< CSpawnPoint * >( pSpawnSpot );
if ( pSpawn )
pSpawn->m_bReserved = false;
return pSpawnSpot;
}
示例5: DropToGround
CBaseEntity *CSDKGameRules::GetPlayerSpawnSpot( CBasePlayer *pPlayer )
{
// get valid spawn point
CBaseEntity *pSpawnSpot = pPlayer->EntSelectSpawnPoint();
// drop down to ground
Vector GroundPos = DropToGround( pPlayer, pSpawnSpot->GetAbsOrigin(), VEC_HULL_MIN, VEC_HULL_MAX );
// Move the player to the place it said.
pPlayer->Teleport( &GroundPos, &pSpawnSpot->GetLocalAngles(), &vec3_origin );
pPlayer->m_Local.m_vecPunchAngle = vec3_angle;
return pSpawnSpot;
}
示例6: SetGoal
bool CAI_LeadBehavior::SetGoal( const AI_LeadArgs_t &args )
{
CBaseEntity *pGoalEnt;
pGoalEnt = gEntList.FindEntityByName( NULL, args.pszGoal );
if ( !pGoalEnt )
return false;
m_args = args; // @Q (toml 08-13-02): need to copy string?
m_goal = pGoalEnt->GetLocalOrigin();
m_goalyaw = (args.flags & AILF_USE_GOAL_FACING) ? pGoalEnt->GetLocalAngles().y : -1;
m_waitpoint = vec3_origin;
m_waitdistance = args.flWaitDistance;
m_leaddistance = args.flLeadDistance ? args.flLeadDistance : 64;
m_retrievedistance = args.flRetrieveDistance ? args.flRetrieveDistance : (m_leaddistance + LEAD_MIN_RETRIEVEDIST_OFFSET);
m_successdistance = args.flSuccessDistance ? args.flSuccessDistance : 0;
m_run = args.bRun;
m_gagleader = args.bGagLeader;
m_hasspokenstart = args.bDontSpeakStart;
m_hasspokenarrival = false;
m_hasPausedScenes = false;
m_flSpeakNextNagTime = 0;
m_flWeaponSafetyTimeOut = 0;
m_flNextLeadIdle = gpGlobals->curtime + 10;
m_bInitialAheadTest = true;
if ( args.pszWaitPoint && args.pszWaitPoint[0] )
{
CBaseEntity *pWaitPoint = gEntList.FindEntityByName( NULL, args.pszWaitPoint );
if ( pWaitPoint )
{
m_waitpoint = pWaitPoint->GetLocalOrigin();
}
}
return true;
}