Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. // tf_bot_vision.h
  3. // Team Fortress NextBot vision interface
  4. // Michael Booth, May 2009
  5. #ifndef TF_BOT_VISION_H
  6. #define TF_BOT_VISION_H
  7. #include "NextBotVisionInterface.h"
  8. //----------------------------------------------------------------------------
  9. class CTFBotVision : public IVision
  10. {
  11. public:
  12. CTFBotVision( INextBot *bot ) : IVision( bot )
  13. {
  14. }
  15. virtual ~CTFBotVision() { }
  16. virtual void Update( void ); // update internal state
  17. /**
  18. * Populate "potentiallyVisible" with the set of all entities we could potentially see.
  19. * Entities in this set will be tested for visibility/recognition in IVision::Update()
  20. */
  21. virtual void CollectPotentiallyVisibleEntities( CUtlVector< CBaseEntity * > *potentiallyVisible );
  22. virtual bool IsIgnored( CBaseEntity *subject ) const; // return true to completely ignore this entity (may not be in sight when this is called)
  23. virtual bool IsVisibleEntityNoticed( CBaseEntity *subject ) const; // return true if we 'notice' the subject, even though we have LOS to it
  24. virtual float GetMaxVisionRange( void ) const; // return maximum distance vision can reach
  25. virtual float GetMinRecognizeTime( void ) const; // return VISUAL reaction time
  26. private:
  27. CUtlVector< CHandle< CBaseCombatCharacter > > m_potentiallyVisibleNPCVector;
  28. CountdownTimer m_potentiallyVisibleUpdateTimer;
  29. void UpdatePotentiallyVisibleNPCVector( void );
  30. CountdownTimer m_scanTimer;
  31. };
  32. #endif // TF_BOT_VISION_H