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.

105 lines
2.4 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef WEAPON_IFMSTEADYCAM_H
  7. #define WEAPON_IFMSTEADYCAM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_ifmbasecamera.h"
  12. #if defined( CLIENT_DLL )
  13. #define CWeaponIFMSteadyCam C_WeaponIFMSteadyCam
  14. #endif
  15. class CWeaponIFMSteadyCam : public CWeaponIFMBaseCamera
  16. {
  17. public:
  18. DECLARE_CLASS( CWeaponIFMSteadyCam, CWeaponIFMBaseCamera );
  19. DECLARE_NETWORKCLASS();
  20. DECLARE_PREDICTABLE();
  21. #ifdef GAME_DLL
  22. DECLARE_DATADESC();
  23. #endif
  24. public:
  25. // Shared code
  26. CWeaponIFMSteadyCam();
  27. virtual void ItemPostFrame();
  28. private:
  29. #ifdef CLIENT_DLL
  30. public:
  31. // Client code
  32. virtual void CreateMove( float flInputSampleTime, CUserCmd *pCmd, const QAngle &vecOldViewAngles );
  33. virtual void DrawCrosshair( void );
  34. virtual void GetToolRecordingState( KeyValues *msg );
  35. private:
  36. // Purpose: Draw the weapon's crosshair
  37. void DrawArmLength( int x, int y, int w, int h, Color clr );
  38. void DrawFOV( int x, int y, int w, int h, Color clrEdges, Color clrTriangle );
  39. // Transmits the lock target
  40. void TransmitLockTarget();
  41. // Updates the relative orientation of the camera
  42. void UpdateRelativeOrientation();
  43. void UpdateLockedRelativeOrientation();
  44. void UpdateDirectRelativeOrientation();
  45. // Computes a matrix given a forward direction
  46. void MatrixFromForwardDirection( const Vector &vecForward, matrix3x4_t &mat );
  47. // Targets the camera to always look at a point
  48. void LockCamera();
  49. // Toggles to springy camera
  50. void ToggleSpringCamera();
  51. void ToggleDirectMode();
  52. // Compute the location of the camera for rendering
  53. virtual void ComputeAbsCameraTransform( Vector &origin, QAngle &angles );
  54. // Updates the relative orientation of the camera, spring mode
  55. void ComputeMouseRay( const VMatrix &steadyCamToPlayer, Vector &vecForward );
  56. // Updates the 2d spring
  57. void ComputeViewOffset();
  58. bool m_bIsLocked;
  59. bool m_bInDirectMode;
  60. bool m_bInSpringMode;
  61. Vector m_vecOffset;
  62. Vector m_vec2DVelocity;
  63. Vector m_vecActualViewOffset;
  64. Vector m_vecViewOffset;
  65. float m_flFOVOffsetY;
  66. vgui::HFont m_hFont;
  67. int m_nTextureId;
  68. #endif // CLIENT_DLL
  69. #ifdef GAME_DLL
  70. public:
  71. // Server code
  72. #endif // GAME_DLL
  73. private:
  74. EHANDLE m_hLockTarget;
  75. private:
  76. CWeaponIFMSteadyCam( const CWeaponIFMSteadyCam & );
  77. };
  78. #endif // WEAPON_IFMSTEADYCAM_H