本文整理汇总了C++中game_import_t::inPVS方法的典型用法代码示例。如果您正苦于以下问题:C++ game_import_t::inPVS方法的具体用法?C++ game_import_t::inPVS怎么用?C++ game_import_t::inPVS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_import_t
的用法示例。
在下文中一共展示了game_import_t::inPVS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: G_DynamicMusicUpdate
//.........这里部分代码省略.........
{
ent = entityList[ e ];
if ( !ent || !ent->inuse )
{
continue;
}
if ( !ent->client || !ent->NPC )
{
if ( ent->classname && (!Q_stricmp( "PAS", ent->classname )||!Q_stricmp( "misc_turret", ent->classname )) )
{//a turret
entTeam = ent->noDamageTeam;
}
else
{
continue;
}
}
else
{//an NPC
entTeam = ent->client->playerTeam;
}
if ( entTeam == player->client->playerTeam )
{//ally
continue;
}
if ( entTeam == TEAM_NEUTRAL && (!ent->enemy || !ent->enemy->client || ent->enemy->client->playerTeam != player->client->playerTeam) )
{//a droid that is not mad at me or my allies
continue;
}
if ( !gi.inPVS( player->currentOrigin, ent->currentOrigin ) )
{//not potentially visible
continue;
}
if ( ent->client && ent->s.weapon == WP_NONE )
{//they don't have a weapon... FIXME: only do this for droids?
continue;
}
LOScalced = clearLOS = qfalse;
if ( (ent->enemy==player&&(!ent->NPC||ent->NPC->confusionTime<level.time)) || (ent->client&&ent->client->ps.weaponTime) || (!ent->client&&ent->attackDebounceTime>level.time))
{//mad
if ( ent->health > 0 )
{//alive
//FIXME: do I really need this check?
if ( ent->s.weapon == WP_SABER && ent->client && !ent->client->ps.saberActive && ent->enemy != player )
{//a Jedi who has not yet gotten made at me
continue;
}
if ( ent->NPC && ent->NPC->behaviorState == BS_CINEMATIC )
{//they're not actually going to do anything about being mad at me...
continue;
}
//okay, they're in my PVS, but how close are they? Are they actively attacking me?
if ( !ent->client && ent->s.weapon == WP_TURRET && ent->fly_sound_debounce_time && ent->fly_sound_debounce_time - level.time < 10000 )
{//a turret that shot at me less than ten seconds ago
}
else if ( ent->client && ent->client->ps.lastShotTime && ent->client->ps.lastShotTime - level.time < 10000 )
{//an NPC that shot at me less than ten seconds ago
}
else
{//not actively attacking me lately, see how far away they are