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.

86 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef WEAPON_IFMBASECAMERA_H
  7. #define WEAPON_IFMBASECAMERA_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "weapon_ifmbase.h"
  12. #ifdef CLIENT_DLL
  13. #include "materialsystem/MaterialSystemUtil.h"
  14. #endif
  15. #if defined( CLIENT_DLL )
  16. #define CWeaponIFMBaseCamera C_WeaponIFMBaseCamera
  17. #endif
  18. class CWeaponIFMBaseCamera : public CWeaponIFMBase
  19. {
  20. public:
  21. DECLARE_CLASS( CWeaponIFMBaseCamera, CWeaponIFMBase );
  22. DECLARE_NETWORKCLASS();
  23. DECLARE_PREDICTABLE();
  24. #ifdef GAME_DLL
  25. DECLARE_DATADESC();
  26. #endif
  27. // Shared code
  28. public:
  29. CWeaponIFMBaseCamera();
  30. #ifdef CLIENT_DLL
  31. // Client code
  32. public:
  33. virtual void ViewModelDrawn( CBaseViewModel *pBaseViewModel );
  34. virtual void DrawCrosshair( );
  35. virtual int DrawModel( int flags );
  36. virtual void OnDataChanged( DataUpdateType_t updateType );
  37. protected:
  38. // Gets the abs orientation of the camera
  39. virtual void ComputeAbsCameraTransform( Vector &vecAbsOrigin, QAngle &angAbsRotation );
  40. // Gets the bounds of the overlay to draw
  41. void GetOverlayBounds( int &x, int &y, int &w, int &h );
  42. // Gets the size of the overlay to draw
  43. void GetViewportSize( int &w, int &h );
  44. void TransmitRenderInfo();
  45. float m_flFOV;
  46. float m_flArmLength;
  47. Vector m_vecRelativePosition;
  48. QAngle m_angRelativeAngles;
  49. int m_nScreenWidth;
  50. int m_nScreenHeight;
  51. bool m_bFullScreen;
  52. CMaterialReference m_FrustumMaterial;
  53. CMaterialReference m_FrustumWireframeMaterial;
  54. #endif
  55. #ifdef GAME_DLL
  56. // Server code
  57. public:
  58. void SetRenderInfo( float flAspectRatio, float flFOV, float flArmLength, const Vector &vecPosition, const QAngle &angles );
  59. #endif
  60. private:
  61. CNetworkVar( float, m_flRenderAspectRatio );
  62. CNetworkVar( float, m_flRenderFOV );
  63. CNetworkVar( float, m_flRenderArmLength );
  64. CNetworkVector( m_vecRenderPosition );
  65. CNetworkQAngle( m_angRenderAngles );
  66. CWeaponIFMBaseCamera( const CWeaponIFMBaseCamera & );
  67. };
  68. #endif // WEAPON_IFMBASECAMERA_H