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.

83 lines
2.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef REPLAYCAMERA_H
  7. #define REPLAYCAMERA_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "GameEventListener.h"
  12. class C_ReplayCamera : CGameEventListener
  13. {
  14. public:
  15. C_ReplayCamera();
  16. virtual ~C_ReplayCamera();
  17. void Init();
  18. void Reset();
  19. void CalcView(Vector& origin, QAngle& angles, float& fov);
  20. void FireGameEvent( IGameEvent *event );
  21. void SetMode(int iMode);
  22. void SetChaseCamParams( float flOffset, float flDistance, float flTheta, float flPhi );
  23. void SpecNextPlayer( bool bInverse );
  24. void SpecNamedPlayer( const char *szPlayerName );
  25. void ToggleChaseAsFirstPerson();
  26. bool IsPVSLocked();
  27. void SetAutoDirector( bool bActive );
  28. int GetMode(); // returns current camera mode
  29. C_BaseEntity *GetPrimaryTarget(); // return primary target
  30. void SetPrimaryTarget( int nEntity); // set the primary obs target
  31. C_BaseEntity *GetCameraMan(); // return camera entity if any
  32. void CreateMove(CUserCmd *cmd);
  33. void FixupMovmentParents();
  34. void PostEntityPacketReceived();
  35. const char* GetTitleText() { return m_szTitleText; }
  36. int GetNumSpectators() { return m_nNumSpectators; }
  37. protected:
  38. void CalcChaseCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
  39. void CalcFixedView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
  40. void CalcInEyeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
  41. void CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float& fov);
  42. void SmoothCameraAngle( QAngle& targetAngle );
  43. void SetCameraAngle( QAngle& targetAngle );
  44. void Accelerate( Vector& wishdir, float wishspeed, float accel );
  45. int m_nCameraMode; // current camera mode
  46. int m_iCameraMan; // camera man entindex or 0
  47. Vector m_vCamOrigin; //current camera origin
  48. QAngle m_aCamAngle; //current camera angle
  49. int m_iTraget1; // first tracked target or 0
  50. int m_iTraget2; // second tracked target or 0
  51. float m_flFOV; // current FOV
  52. float m_flOffset; // z-offset from target origin
  53. float m_flDistance; // distance to traget origin+offset
  54. float m_flLastDistance; // too smooth distance
  55. float m_flTheta; // view angle horizontal
  56. float m_flPhi; // view angle vertical
  57. float m_flInertia; // camera inertia 0..100
  58. float m_flLastAngleUpdateTime;
  59. bool m_bEntityPacketReceived; // true after a new packet was received
  60. int m_nNumSpectators;
  61. char m_szTitleText[64];
  62. CUserCmd m_LastCmd;
  63. Vector m_vecVelocity;
  64. };
  65. extern C_ReplayCamera *ReplayCamera(); // get Singleton
  66. #endif // REPLAYCAMERA_H