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.

81 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Defines the player specific data that is sent only to the player
  4. // to whom it belongs.
  5. //
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef C_PLAYERLOCALDATA_H
  9. #define C_PLAYERLOCALDATA_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "basetypes.h"
  14. #include "mathlib/vector.h"
  15. #include "playernet_vars.h"
  16. //-----------------------------------------------------------------------------
  17. // Purpose: Player specific data ( sent only to local player, too )
  18. //-----------------------------------------------------------------------------
  19. class CPlayerLocalData
  20. {
  21. public:
  22. DECLARE_PREDICTABLE();
  23. DECLARE_CLASS_NOBASE( CPlayerLocalData );
  24. DECLARE_EMBEDDED_NETWORKVAR();
  25. CPlayerLocalData() :
  26. m_iv_vecPunchAngle( "CPlayerLocalData::m_iv_vecPunchAngle" ),
  27. m_iv_vecPunchAngleVel( "CPlayerLocalData::m_iv_vecPunchAngleVel" )
  28. {
  29. m_iv_vecPunchAngle.Setup( &m_vecPunchAngle.m_Value, LATCH_SIMULATION_VAR );
  30. m_iv_vecPunchAngleVel.Setup( &m_vecPunchAngleVel.m_Value, LATCH_SIMULATION_VAR );
  31. m_flFOVRate = 0;
  32. }
  33. unsigned char m_chAreaBits[MAX_AREA_STATE_BYTES]; // Area visibility flags.
  34. unsigned char m_chAreaPortalBits[MAX_AREA_PORTAL_STATE_BYTES];// Area portal visibility flags.
  35. int m_iHideHUD; // bitfields containing sections of the HUD to hide
  36. float m_flFOVRate; // rate at which the FOV changes
  37. bool m_bDucked;
  38. bool m_bDucking;
  39. bool m_bInDuckJump;
  40. float m_flDucktime;
  41. float m_flDuckJumpTime;
  42. float m_flJumpTime;
  43. int m_nStepside;
  44. float m_flFallVelocity;
  45. int m_nOldButtons;
  46. float m_flOldForwardMove;
  47. // Base velocity that was passed in to server physics so
  48. // client can predict conveyors correctly. Server zeroes it, so we need to store here, too.
  49. Vector m_vecClientBaseVelocity;
  50. CNetworkQAngle( m_vecPunchAngle ); // auto-decaying view angle adjustment
  51. CInterpolatedVar< QAngle > m_iv_vecPunchAngle;
  52. CNetworkQAngle( m_vecPunchAngleVel ); // velocity of auto-decaying view angle adjustment
  53. CInterpolatedVar< QAngle > m_iv_vecPunchAngleVel;
  54. bool m_bDrawViewmodel;
  55. bool m_bWearingSuit;
  56. bool m_bPoisoned;
  57. float m_flStepSize;
  58. bool m_bAllowAutoMovement;
  59. // 3d skybox
  60. sky3dparams_t m_skybox3d;
  61. // fog params
  62. fogplayerparams_t m_PlayerFog;
  63. // audio environment
  64. audioparams_t m_audio;
  65. bool m_bSlowMovement;
  66. };
  67. #endif // C_PLAYERLOCALDATA_H