summaryrefslogtreecommitdiff
path: root/game/server/tf/bot/tf_bot_locomotion.h
blob: 40cad56aebee7d7ff38477766068fb5200f7f793 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//========= Copyright Valve Corporation, All rights reserved. ============//
// tf_bot_locomotion.h
// Team Fortress NextBot locomotion interface
// Michael Booth, May 2010

#ifndef TF_BOT_LOCOMOTION_H
#define TF_BOT_LOCOMOTION_H

#include "NextBot/Player/NextBotPlayerLocomotion.h"

//----------------------------------------------------------------------------
class CTFBotLocomotion : public PlayerLocomotion
{
public:
	DECLARE_CLASS( CTFBotLocomotion, PlayerLocomotion );

	CTFBotLocomotion( INextBot *bot ) : PlayerLocomotion( bot )
	{
	}

	virtual ~CTFBotLocomotion() { }

	virtual void Update( void );								// (EXTEND) update internal state

	virtual void Approach( const Vector &pos, float goalWeight = 1.0f );	// move directly towards the given position

	virtual float GetMaxJumpHeight( void ) const;				// return maximum height of a jump
	virtual float GetDeathDropHeight( void ) const;			// distance at which we will die if we fall

	virtual float GetRunSpeed( void ) const;				// get maximum running speed

	virtual bool IsAreaTraversable( const CNavArea *baseArea ) const;	// return true if given area can be used for navigation
	virtual bool IsEntityTraversable( CBaseEntity *obstacle, TraverseWhenType when = EVENTUALLY ) const;

	//
	// ILocomotion modifiers
	//
	virtual void Jump( void ) OVERRIDE;								// initiate a simple undirected jump in the air

protected:
	virtual void AdjustPosture( const Vector &moveGoal ) { }	// never crouch to navigate
};

inline float CTFBotLocomotion::GetMaxJumpHeight( void ) const
{
	// http://developer.valvesoftware.com/wiki/TF2/Team_Fortress_2_Mapper%27s_Reference
	return 72.0f;
}

#endif // TF_BOT_LOCOMOTION_H