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.

50 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. // tf_bot_locomotion.h
  3. // Team Fortress NextBot locomotion interface
  4. // Michael Booth, May 2010
  5. #ifndef TF_BOT_LOCOMOTION_H
  6. #define TF_BOT_LOCOMOTION_H
  7. #include "NextBot/Player/NextBotPlayerLocomotion.h"
  8. //----------------------------------------------------------------------------
  9. class CTFBotLocomotion : public PlayerLocomotion
  10. {
  11. public:
  12. DECLARE_CLASS( CTFBotLocomotion, PlayerLocomotion );
  13. CTFBotLocomotion( INextBot *bot ) : PlayerLocomotion( bot )
  14. {
  15. }
  16. virtual ~CTFBotLocomotion() { }
  17. virtual void Update( void ); // (EXTEND) update internal state
  18. virtual void Approach( const Vector &pos, float goalWeight = 1.0f ); // move directly towards the given position
  19. virtual float GetMaxJumpHeight( void ) const; // return maximum height of a jump
  20. virtual float GetDeathDropHeight( void ) const; // distance at which we will die if we fall
  21. virtual float GetRunSpeed( void ) const; // get maximum running speed
  22. virtual bool IsAreaTraversable( const CNavArea *baseArea ) const; // return true if given area can be used for navigation
  23. virtual bool IsEntityTraversable( CBaseEntity *obstacle, TraverseWhenType when = EVENTUALLY ) const;
  24. //
  25. // ILocomotion modifiers
  26. //
  27. virtual void Jump( void ) OVERRIDE; // initiate a simple undirected jump in the air
  28. protected:
  29. virtual void AdjustPosture( const Vector &moveGoal ) { } // never crouch to navigate
  30. };
  31. inline float CTFBotLocomotion::GetMaxJumpHeight( void ) const
  32. {
  33. // http://developer.valvesoftware.com/wiki/TF2/Team_Fortress_2_Mapper%27s_Reference
  34. return 72.0f;
  35. }
  36. #endif // TF_BOT_LOCOMOTION_H