36 #include "../../idlib/precompiled.h"
39 #include "../Game_local.h"
66 int numListedEntities;
70 idVec3 offsetVec( 0, 0, offset );
71 idEntity *enemyEnt = enemy.GetEntity();
77 idVec3 enemyEyePos = lastVisibleEnemyPos + lastVisibleEnemyEyeOffset;
78 const idBounds &myBounds = physicsObj.GetAbsBounds();
84 for ( i = 0; i < numListedEntities; i++, index++ ) {
85 if ( index >= numListedEntities ) {
88 ent = entityList[
index ];
89 if ( !ent->
IsType( idMoveable::Type ) ) {
100 dist = ( entOrg - enemyEyePos ).LengthFast();
101 if ( dist < minDist ) {
111 if ( PredictTrajectory( entPhys->
GetOrigin() + offsetVec, enemyEyePos, speed, entPhys->
GetGravity(),
143 if ( ent->
IsType( idMoveable::Type ) ) {
virtual const idVec3 & GetOrigin(int id=0) const =0
idBounds & TranslateSelf(const idVec3 &translation)
virtual int GetClipMask(int id=-1) const =0
struct idEntity::entityFlags_s fl
type * GetEntity(void) const
bool IsType(const idTypeInfo &c) const
idEntityPtr< idActor > enemy
virtual void SetLinearVelocity(const idVec3 &newLinearVelocity, int id=0)=0
idVec3 lastVisibleEnemyPos
idCVar ai_debugTrajectory("ai_debugTrajectory","0", CVAR_GAME|CVAR_BOOL,"draws trajectory tests for monsters")
float GetRadius(void) const
#define EVENT(event, function)
int EntitiesTouchingBounds(const idBounds &bounds, int contentMask, idEntity **entityList, int maxCount) const
virtual const idBounds & GetBounds(int id=-1) const =0
idPhysics * GetPhysics(void) const
idBounds Expand(const float d) const
virtual idClipModel * GetClipModel(int id=0) const =0
bool LineIntersection(const idVec3 &start, const idVec3 &end) const
idVec3 lastVisibleEnemyEyeOffset
static bool PredictTrajectory(const idVec3 &firePos, const idVec3 &target, float projectileSpeed, const idVec3 &projGravity, const idClipModel *clip, int clipmask, float max_height, const idEntity *ignore, const idEntity *targetEntity, int drawtime, idVec3 &aimDir)
idPhysics_Monster physicsObj
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
static void ReturnEntity(idEntity *ent)
CLASS_PROTOTYPE(idAI_Vagary)
const idMat3 & GetGravityAxis(void) const
void Event_ThrowObjectAtEnemy(idEntity *ent, float speed)
const idEventDef AI_Vagary_ChooseObjectToThrow("vagary_ChooseObjectToThrow","vvfff", 'e')
void EnableDamage(bool enable, float duration)
const idEventDef AI_Vagary_ThrowObjectAtEnemy("vagary_ThrowObjectAtEnemy","ef")
virtual const idVec3 & GetGravity(void) const =0
void Event_ChooseObjectToThrow(const idVec3 &mins, const idVec3 &maxs, float speed, float minDist, float offset)