Counter Strike : Global Offensive Source Code
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.

55 lines
1.2 KiB

  1. // NextBotBodyInterface.cpp
  2. // Control and information about the bot's body state (posture, animation state, etc)
  3. // Author: Michael Booth, April 2006
  4. // Copyright (c) 2006 Turtle Rock Studios, Inc. - All Rights Reserved
  5. #include "cbase.h"
  6. #include "NextBot.h"
  7. #include "NextBotBodyInterface.h"
  8. void IBody::AimHeadTowards( const Vector &lookAtPos, LookAtPriorityType priority, float duration, INextBotReply *replyWhenAimed, const char *reason )
  9. {
  10. if ( replyWhenAimed )
  11. {
  12. replyWhenAimed->OnFail( GetBot(), INextBotReply::FAILED );
  13. }
  14. }
  15. void IBody::AimHeadTowards( CBaseEntity *subject, LookAtPriorityType priority, float duration, INextBotReply *replyWhenAimed, const char *reason )
  16. {
  17. if ( replyWhenAimed )
  18. {
  19. replyWhenAimed->OnFail( GetBot(), INextBotReply::FAILED );
  20. }
  21. }
  22. bool IBody::SetPosition( const Vector &pos )
  23. {
  24. GetBot()->GetEntity()->SetAbsOrigin( pos );
  25. return true;
  26. }
  27. const Vector &IBody::GetEyePosition( void ) const
  28. {
  29. static Vector eye;
  30. eye = GetBot()->GetEntity()->WorldSpaceCenter();
  31. return eye;
  32. }
  33. const Vector &IBody::GetViewVector( void ) const
  34. {
  35. static Vector view;
  36. AngleVectors( GetBot()->GetEntity()->EyeAngles(), &view );
  37. return view;
  38. }
  39. bool IBody::IsHeadAimingOnTarget( void ) const
  40. {
  41. return false;
  42. }