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.

47 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef PLAYER_CONTROLLER_H
  7. #define PLAYER_CONTROLLER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class IPhysicsPlayerControllerEvent
  12. {
  13. public:
  14. virtual int ShouldMoveTo( IPhysicsObject *pObject, const Vector &position ) = 0;
  15. };
  16. class IPhysicsPlayerController
  17. {
  18. public:
  19. virtual ~IPhysicsPlayerController( void ) {}
  20. virtual void Update( const Vector &position, const Vector &velocity, float secondsToArrival, bool onground, IPhysicsObject *ground ) = 0;
  21. virtual void SetEventHandler( IPhysicsPlayerControllerEvent *handler ) = 0;
  22. virtual bool IsInContact( void ) = 0;
  23. virtual void MaxSpeed( const Vector &maxVelocity ) = 0;
  24. // allows game code to change collision models
  25. virtual void SetObject( IPhysicsObject *pObject ) = 0;
  26. // UNDONE: Refactor this and shadow controllers into a single class/interface through IPhysicsObject
  27. virtual int GetShadowPosition( Vector *position, QAngle *angles ) = 0;
  28. virtual void StepUp( float height ) = 0;
  29. virtual void Jump() = 0;
  30. virtual void GetShadowVelocity( Vector *velocity ) = 0;
  31. virtual IPhysicsObject *GetObject() = 0;
  32. virtual void GetLastImpulse( Vector *pOut ) = 0;
  33. virtual void SetPushMassLimit( float maxPushMass ) = 0;
  34. virtual void SetPushSpeedLimit( float maxPushSpeed ) = 0;
  35. virtual float GetPushMassLimit() = 0;
  36. virtual float GetPushSpeedLimit() = 0;
  37. virtual bool WasFrozen() = 0;
  38. };
  39. #endif // PLAYER_CONTROLLER_H