summaryrefslogtreecommitdiff
path: root/game/server/NextBot/NextBotBodyInterface.cpp
blob: 143ed4cd800e901026465a5c25023e57e9262301 (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
51
52
53
54
55
// NextBotBodyInterface.cpp
// Control and information about the bot's body state (posture, animation state, etc)
// Author: Michael Booth, April 2006
//========= Copyright Valve Corporation, All rights reserved. ============//

#include "cbase.h"

#include "NextBot.h"
#include "NextBotBodyInterface.h"


void IBody::AimHeadTowards( const Vector &lookAtPos, LookAtPriorityType priority, float duration, INextBotReply *replyWhenAimed, const char *reason )
{
	if ( replyWhenAimed )
	{
		replyWhenAimed->OnFail( GetBot(), INextBotReply::FAILED );
	}
}

void IBody::AimHeadTowards( CBaseEntity *subject, LookAtPriorityType priority, float duration, INextBotReply *replyWhenAimed, const char *reason )
{
	if ( replyWhenAimed )
	{
		replyWhenAimed->OnFail( GetBot(), INextBotReply::FAILED );
	}
}

bool IBody::SetPosition( const Vector &pos )
{
	GetBot()->GetEntity()->SetAbsOrigin( pos );
	return true;
}

const Vector &IBody::GetEyePosition( void ) const
{
	static Vector eye;

	eye = GetBot()->GetEntity()->WorldSpaceCenter();

	return eye;
}

const Vector &IBody::GetViewVector( void ) const
{
	static Vector view;
	
	AngleVectors( GetBot()->GetEntity()->EyeAngles(), &view );

	return view;
}

bool IBody::IsHeadAimingOnTarget( void ) const
{
	return false;
}