#include "g_local.h"#include "b_public.h"#include "say.h"#include "ai.h"Go to the source code of this file.
|
|
|
|
|
Definition at line 164 of file b_local.h. Referenced by ClearPlayerAlertEvents(), and CorpsePhysics(). |
|
|
Definition at line 166 of file b_local.h. Referenced by NPC_BSFollowLeader(), NPC_CheckCanAttack(), NPC_CheckPossibleEnemy(), NPC_CheckVisibility(), NPC_PickAlly(), and NPC_PickEnemy(). |
|
|
Definition at line 167 of file b_local.h. Referenced by NPC_BSAdvanceFight(), NPC_BSFollowLeader(), NPC_BSHuntAndKill(), NPC_CheckCanAttack(), NPC_CheckPossibleEnemy(), NPC_CheckVisibility(), and NPC_PickEnemy(). |
|
|
Definition at line 165 of file b_local.h. Referenced by NPC_BSFollowLeader(), and NPC_CheckVisibility(). |
|
|
Definition at line 168 of file b_local.h. Referenced by NPC_BSFollowLeader(), NPC_BSHuntAndKill(), and NPC_CheckVisibility(). |
|
|
Definition at line 169 of file b_local.h. Referenced by NPC_CheckVisibility(), NPC_PickAlly(), and NPC_PickEnemy(). |
|
|
|
|
|
Definition at line 243 of file b_local.h. Referenced by ST_Commander(). |
|
|
Definition at line 253 of file b_local.h. Referenced by NPC_FindCombatPoint(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 252 of file b_local.h. Referenced by NPC_FindCombatPoint(), NPC_StartFlee(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 249 of file b_local.h. Referenced by NPC_FindCombatPoint(), and ST_Commander(). |
|
|
Definition at line 245 of file b_local.h. Referenced by NPC_FindCombatPoint(), ST_ApproachEnemy(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 254 of file b_local.h. Referenced by ST_ApproachEnemy(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 244 of file b_local.h. Referenced by NPC_FindCombatPoint(), NPC_StartFlee(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 247 of file b_local.h. Referenced by ST_Commander(). |
|
|
Definition at line 255 of file b_local.h. Referenced by NPC_FindCombatPoint(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 246 of file b_local.h. Referenced by ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 256 of file b_local.h. Referenced by NPC_FindCombatPoint(), NPC_StartFlee(), and ST_Commander(). |
|
|
Definition at line 259 of file b_local.h. Referenced by NPC_FindCombatPoint(). |
|
|
Definition at line 250 of file b_local.h. Referenced by ST_Commander(). |
|
|
Definition at line 248 of file b_local.h. Referenced by NPC_FindCombatPoint(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 260 of file b_local.h. Referenced by NPC_FindCombatPoint(), and NPC_StartFlee(). |
|
|
Definition at line 261 of file b_local.h. Referenced by NPC_FindCombatPoint(), ST_Commander(), and ST_GetCPFlags(). |
|
|
Definition at line 258 of file b_local.h. Referenced by ST_Commander(), and ST_GetCPFlags(). |
|
|
|
|
|
Definition at line 251 of file b_local.h. Referenced by ST_Commander(). |
|
|
Definition at line 264 of file b_local.h. Referenced by ST_Commander(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 267 of file b_local.h. Referenced by NPC_FindSquadPoint(). |
|
|
Definition at line 22 of file b_local.h. Referenced by Debug_NPCPrintf(), and Debug_Printf(). |
|
|
Definition at line 25 of file b_local.h. Referenced by Debug_NPCPrintf(), and Debug_Printf(). |
|
|
Definition at line 23 of file b_local.h. Referenced by Debug_NPCPrintf(), Debug_Printf(), and NPC_PickEnemy(). |
|
|
|
|
|
Definition at line 24 of file b_local.h. Referenced by Debug_NPCPrintf(), and Debug_Printf(). |
|
|
|
|
|
|
|
|
Definition at line 29 of file b_local.h. Referenced by NPC_BSJump(), and NPC_UpdateAngles(). |
|
|
Definition at line 31 of file b_local.h. Referenced by Boba_FireDecide(), NPC_BSST_Attack(), and ST_Commander(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 306 of file b_local.h. Referenced by NAV_AvoidCollision(), and NAV_TestForBlocked(). |
|
|
Definition at line 305 of file b_local.h. Referenced by NAV_AvoidCollision(), and NAVNEW_AvoidCollision(). |
|
|
|
|
|
Definition at line 304 of file b_local.h. Referenced by NPC_GetMoveDirection(), and NPC_GetMoveDirectionAltRoute(). |
|
|
|
|
|
|
|
|
Definition at line 147 of file b_local.h. Referenced by NPC_Begin(), and NPC_SetMiscDefaultData(). |
|
|
|
|
|
|
|
|
Definition at line 148 of file b_local.h. Referenced by NPC_Begin(). |
|
|
|
|
|
Definition at line 141 of file b_local.h. Referenced by NPC_WeaponsForTeam(). |
|
|
Definition at line 139 of file b_local.h. Referenced by NPC_WeaponsForTeam(). |
|
|
|
|
|
Definition at line 149 of file b_local.h. Referenced by NPC_Begin(). |
|
|
|
|
|
|
|
|
Referenced by AI_CheckEnemyCollision(), NAV_AvoidCollision(), NAV_GetLastMove(), NAV_MoveToGoal(), NAVNEW_AvoidCollision(), NAVNEW_MoveToGoal(), and NPC_GetMoveDirectionAltRoute(). |
|
||||||||||||||||
|
Definition at line 20 of file NPC_utils.c. References entityShared_t::absmax, entityShared_t::absmin, AngleVectors(), CalcMuzzlePoint(), CLASS_ATST, gentity_s::client, entityShared_t::currentOrigin, trace_t::endpos, renderInfo_s::eyePoint, trace_t::fraction, gentity_t, entityState_s::groundEntityNum, MASK_PLAYERSOLID, entityShared_t::maxs, entityShared_t::mins, gentity_s::NPC, gclient_s::NPC_class, entityState_s::number, gclient_s::ps, gentity_s::r, gclient_s::renderInfo, gentity_s::s, gNPC_t::shootAngles, SPOT_CHEST, SPOT_GROUND, SPOT_HEAD, SPOT_HEAD_LEAN, SPOT_LEGS, SPOT_ORIGIN, SPOT_WEAPON, trap_Trace(), vec3_origin, vec3_t, VectorCopy, VectorMA, VectorSubtract, playerState_s::viewangles, and playerState_s::viewheight. Referenced by Boba_FireDecide(), CanSee(), CanShoot(), G_CheckAlertEvents(), G_ClearLOS2(), G_ClearLOS3(), G_ClearLOS4(), G_ClearLOS5(), G_FindLocalInterestPoint(), ImperialProbe_FireBlaster(), InFOV(), InFOV2(), InVisrange(), Mark1_FireBlaster(), Mark1_FireRocket(), Mark2_FireBlaster(), NPC_BSAdvanceFight(), NPC_BSCinematic(), NPC_BSFollowLeader(), NPC_BSGM_Attack(), NPC_BSPointShoot(), NPC_CheckCanAttack(), NPC_ClearShot(), NPC_FaceEntity(), NPC_FacePosition(), NPC_ShotEntity(), Remote_Fire(), Seeker_Fire(), Sniper_FaceEnemy(), and Sniper_UpdateEnemyPos().
00021 {
00022 vec3_t forward, up, right;
00023 vec3_t start, end;
00024 trace_t tr;
00025
00026 if ( !ent )
00027 {
00028 return;
00029 }
00030 switch ( spot )
00031 {
00032 case SPOT_ORIGIN:
00033 if(VectorCompare(ent->r.currentOrigin, vec3_origin))
00034 {//brush
00035 VectorSubtract(ent->r.absmax, ent->r.absmin, point);//size
00036 VectorMA(ent->r.absmin, 0.5, point, point);
00037 }
00038 else
00039 {
00040 VectorCopy ( ent->r.currentOrigin, point );
00041 }
00042 break;
00043
00044 case SPOT_CHEST:
00045 case SPOT_HEAD:
00046 if ( ent->client && VectorLengthSquared( ent->client->renderInfo.eyePoint ) /*&& (ent->client->ps.viewEntity <= 0 || ent->client->ps.viewEntity >= ENTITYNUM_WORLD)*/ )
00047 {//Actual tag_head eyespot!
00048 //FIXME: Stasis aliens may have a problem here...
00049 VectorCopy( ent->client->renderInfo.eyePoint, point );
00050 if ( ent->client->NPC_class == CLASS_ATST )
00051 {//adjust up some
00052 point[2] += 28;//magic number :)
00053 }
00054 if ( ent->NPC )
00055 {//always aim from the center of my bbox, so we don't wiggle when we lean forward or backwards
00056 point[0] = ent->r.currentOrigin[0];
00057 point[1] = ent->r.currentOrigin[1];
00058 }
00059 /*
00060 else if (ent->s.eType == ET_PLAYER )
00061 {
00062 SubtractLeanOfs( ent, point );
00063 }
00064 */
00065 }
00066 else
00067 {
00068 VectorCopy ( ent->r.currentOrigin, point );
00069 if ( ent->client )
00070 {
00071 point[2] += ent->client->ps.viewheight;
00072 }
00073 }
00074 if ( spot == SPOT_CHEST && ent->client )
00075 {
00076 if ( ent->client->NPC_class != CLASS_ATST )
00077 {//adjust up some
00078 point[2] -= ent->r.maxs[2]*0.2f;
00079 }
00080 }
00081 break;
00082
00083 case SPOT_HEAD_LEAN:
00084 if ( ent->client && VectorLengthSquared( ent->client->renderInfo.eyePoint ) /*&& (ent->client->ps.viewEntity <= 0 || ent->client->ps.viewEntity >= ENTITYNUM_WORLD*/ )
00085 {//Actual tag_head eyespot!
00086 //FIXME: Stasis aliens may have a problem here...
00087 VectorCopy( ent->client->renderInfo.eyePoint, point );
00088 if ( ent->client->NPC_class == CLASS_ATST )
00089 {//adjust up some
00090 point[2] += 28;//magic number :)
00091 }
00092 if ( ent->NPC )
00093 {//always aim from the center of my bbox, so we don't wiggle when we lean forward or backwards
00094 point[0] = ent->r.currentOrigin[0];
00095 point[1] = ent->r.currentOrigin[1];
00096 }
00097 /*
00098 else if ( ent->s.eType == ET_PLAYER )
00099 {
00100 SubtractLeanOfs( ent, point );
00101 }
00102 */
00103 //NOTE: automatically takes leaning into account!
00104 }
00105 else
00106 {
00107 VectorCopy ( ent->r.currentOrigin, point );
00108 if ( ent->client )
00109 {
00110 point[2] += ent->client->ps.viewheight;
00111 }
00112 //AddLeanOfs ( ent, point );
00113 }
00114 break;
00115
00116 //FIXME: implement...
00117 //case SPOT_CHEST:
00118 //Returns point 3/4 from tag_torso to tag_head?
00119 //break;
00120
00121 case SPOT_LEGS:
00122 VectorCopy ( ent->r.currentOrigin, point );
00123 point[2] += (ent->r.mins[2] * 0.5);
00124 break;
00125
00126 case SPOT_WEAPON:
00127 if( ent->NPC && !VectorCompare( ent->NPC->shootAngles, vec3_origin ) && !VectorCompare( ent->NPC->shootAngles, ent->client->ps.viewangles ))
00128 {
00129 AngleVectors( ent->NPC->shootAngles, forward, right, up );
00130 }
00131 else
00132 {
00133 AngleVectors( ent->client->ps.viewangles, forward, right, up );
00134 }
00135 CalcMuzzlePoint( (gentity_t*)ent, forward, right, up, point );
00136 //NOTE: automatically takes leaning into account!
00137 break;
00138
00139 case SPOT_GROUND:
00140 // if entity is on the ground, just use it's absmin
00141 if ( ent->s.groundEntityNum != -1 )
00142 {
00143 VectorCopy( ent->r.currentOrigin, point );
00144 point[2] = ent->r.absmin[2];
00145 break;
00146 }
00147
00148 // if it is reasonably close to the ground, give the point underneath of it
00149 VectorCopy( ent->r.currentOrigin, start );
00150 start[2] = ent->r.absmin[2];
00151 VectorCopy( start, end );
00152 end[2] -= 64;
00153 trap_Trace( &tr, start, ent->r.mins, ent->r.maxs, end, ent->s.number, MASK_PLAYERSOLID );
00154 if ( tr.fraction < 1.0 )
00155 {
00156 VectorCopy( tr.endpos, point);
00157 break;
00158 }
00159
00160 // otherwise just use the origin
00161 VectorCopy( ent->r< |