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.

57 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // improv_locomotor.h
  9. // Interface for moving Improvs along computed paths
  10. // Author: Michael Booth, July 2004
  11. #ifndef _IMPROV_LOCOMOTOR_H_
  12. #define _IMPROV_LOCOMOTOR_H_
  13. // TODO: Remove duplicate methods from CImprov, and update CImprov to use this class
  14. /**
  15. * A locomotor owns the movement of an Improv
  16. */
  17. class CImprovLocomotor
  18. {
  19. public:
  20. virtual const Vector &GetCentroid( void ) const = 0;
  21. virtual const Vector &GetFeet( void ) const = 0; ///< return position of "feet" - point below centroid of improv at feet level
  22. virtual const Vector &GetEyes( void ) const = 0;
  23. virtual float GetMoveAngle( void ) const = 0; ///< return direction of movement
  24. virtual CNavArea *GetLastKnownArea( void ) const = 0;
  25. virtual bool GetSimpleGroundHeightWithFloor( const Vector &pos, float *height, Vector *normal = NULL ) = 0; ///< find "simple" ground height, treating current nav area as part of the floor
  26. virtual void Crouch( void ) = 0;
  27. virtual void StandUp( void ) = 0; ///< "un-crouch"
  28. virtual bool IsCrouching( void ) const = 0;
  29. virtual void Jump( void ) = 0; ///< initiate a jump
  30. virtual bool IsJumping( void ) const = 0;
  31. virtual void Run( void ) = 0; ///< set movement speed to running
  32. virtual void Walk( void ) = 0; ///< set movement speed to walking
  33. virtual bool IsRunning( void ) const = 0;
  34. virtual void StartLadder( const CNavLadder *ladder, NavTraverseType how, const Vector &approachPos, const Vector &departPos ) = 0; ///< invoked when a ladder is encountered while following a path
  35. virtual bool TraverseLadder( const CNavLadder *ladder, NavTraverseType how, const Vector &approachPos, const Vector &departPos, float deltaT ) = 0; ///< traverse given ladder
  36. virtual bool IsUsingLadder( void ) const = 0;
  37. enum MoveToFailureType
  38. {
  39. FAIL_INVALID_PATH,
  40. FAIL_STUCK,
  41. FAIL_FELL_OFF,
  42. };
  43. virtual void TrackPath( const Vector &pathGoal, float deltaT ) = 0; ///< move along path by following "pathGoal"
  44. virtual void OnMoveToSuccess( const Vector &goal ) { } ///< invoked when an improv reaches its MoveTo goal
  45. virtual void OnMoveToFailure( const Vector &goal, MoveToFailureType reason ) { } ///< invoked when an improv fails to reach a MoveTo goal
  46. };
  47. #endif // _IMPROV_LOCOMOTOR_H_