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.8 KiB

  1. //========= Copyright � 1996-2005, 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. enum PlayerContactState_t
  17. {
  18. PLAYER_CONTACT_PHYSICS = 1,
  19. PLAYER_CONTACT_GAMEOBJECT = 2,
  20. };
  21. class IPhysicsPlayerController
  22. {
  23. public:
  24. virtual ~IPhysicsPlayerController( void ) {}
  25. virtual void Update( const Vector &position, const Vector &velocity, float secondsToArrival, bool onground, IPhysicsObject *ground ) = 0;
  26. virtual void SetEventHandler( IPhysicsPlayerControllerEvent *handler ) = 0;
  27. virtual bool IsInContact( void ) = 0;
  28. virtual void MaxSpeed( const Vector &maxVelocity ) = 0;
  29. // allows game code to change collision models
  30. virtual void SetObject( IPhysicsObject *pObject ) = 0;
  31. // UNDONE: Refactor this and shadow controllers into a single class/interface through IPhysicsObject
  32. virtual int GetShadowPosition( Vector *position, QAngle *angles ) = 0;
  33. virtual void StepUp( float height ) = 0;
  34. virtual void Jump() = 0;
  35. virtual void GetShadowVelocity( Vector *velocity ) = 0;
  36. virtual IPhysicsObject *GetObject() = 0;
  37. virtual void GetLastImpulse( Vector *pOut ) = 0;
  38. virtual void SetPushMassLimit( float maxPushMass ) = 0;
  39. virtual void SetPushSpeedLimit( float maxPushSpeed ) = 0;
  40. virtual float GetPushMassLimit() = 0;
  41. virtual float GetPushSpeedLimit() = 0;
  42. virtual bool WasFrozen() = 0;
  43. // returns bitfield e.g. 0 (no contacts), 1 (has physics contact), 2 (contact matching nGameFlags), 3 (both 1 & 2)
  44. virtual uint32 GetContactState( uint16 nGameFlags ) = 0;
  45. };
  46. #endif // PLAYER_CONTROLLER_H