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.

137 lines
3.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef BASEPLAYER_SHARED_H
  8. #define BASEPLAYER_SHARED_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. // PlayerUse defines
  13. #ifdef PORTAL2
  14. #define PLAYER_USE_RADIUS 100.f
  15. #else
  16. #define PLAYER_USE_RADIUS 80.f
  17. #define PLAYER_USE_BOT_RADIUS 140.f
  18. #endif // PORTAL2
  19. #define CONE_45_DEGREES 0.707f
  20. #define CONE_15_DEGREES 0.9659258f
  21. #define CONE_90_DEGREES 0
  22. #define TRAIN_ACTIVE 0x80
  23. #define TRAIN_NEW 0xc0
  24. #define TRAIN_OFF 0x00
  25. #define TRAIN_NEUTRAL 0x01
  26. #define TRAIN_SLOW 0x02
  27. #define TRAIN_MEDIUM 0x03
  28. #define TRAIN_FAST 0x04
  29. #define TRAIN_BACK 0x05
  30. // entity messages
  31. #define UPDATE_PLAYER_RADAR 2
  32. #define DEATH_ANIMATION_TIME 3.0f
  33. // multiplayer only
  34. #define NOINTERP_PARITY_MAX 4
  35. #define NOINTERP_PARITY_MAX_BITS 2
  36. struct autoaim_params_t
  37. {
  38. autoaim_params_t()
  39. {
  40. m_fScale = 0;
  41. m_fMaxDist = 0;
  42. m_fMaxDeflection = -1.0f;
  43. m_bOnTargetQueryOnly = false;
  44. }
  45. Vector m_vecAutoAimDir; // Output: The direction autoaim wishes to point.
  46. Vector m_vecAutoAimPoint; // Output: The point (world space) that autoaim is aiming at.
  47. EHANDLE m_hAutoAimEntity; // Output: The entity that autoaim is aiming at.
  48. float m_fScale; // Input:
  49. float m_fMaxDist; // Input:
  50. float m_fMaxDeflection; // Input:
  51. bool m_bOnTargetQueryOnly; // Input: Don't do expensive assistance, just resolve m_bOnTargetNatural
  52. bool m_bAutoAimAssisting; // Output: If this is true, autoaim is aiming at the target.
  53. bool m_bOnTargetNatural; // Output: If true, the player is on target without assistance.
  54. };
  55. enum stepsoundtimes_t
  56. {
  57. STEPSOUNDTIME_NORMAL = 0,
  58. STEPSOUNDTIME_ON_LADDER,
  59. STEPSOUNDTIME_WATER_KNEE,
  60. STEPSOUNDTIME_WATER_FOOT,
  61. };
  62. //
  63. // Player PHYSICS FLAGS bits
  64. //
  65. enum PlayerPhysFlag_e
  66. {
  67. PFLAG_DIROVERRIDE = ( 1<<0 ), // override the player's directional control (trains, physics gun, etc.)
  68. PFLAG_DUCKING = ( 1<<1 ), // In the process of ducking, but totally squatted yet
  69. PFLAG_USING = ( 1<<2 ), // Using a continuous entity
  70. PFLAG_OBSERVER = ( 1<<3 ), // player is locked in stationary cam mode. Spectators can move, observers can't.
  71. PFLAG_VPHYSICS_MOTIONCONTROLLER = ( 1<<4 ), // player is physically attached to a motion controller
  72. PFLAG_GAMEPHYSICS_ROTPUSH = (1<<5), // game physics did a rotating push that we may want to override with vphysics
  73. // If you add another flag here check that you aren't
  74. // overwriting phys flags in the HL2 of TF2 player classes
  75. };
  76. enum
  77. {
  78. VPHYS_WALK = 0,
  79. VPHYS_CROUCH,
  80. VPHYS_NOCLIP,
  81. };
  82. // useful cosines
  83. #define DOT_1DEGREE 0.9998476951564
  84. #define DOT_2DEGREE 0.9993908270191
  85. #define DOT_3DEGREE 0.9986295347546
  86. #define DOT_4DEGREE 0.9975640502598
  87. #define DOT_5DEGREE 0.9961946980917
  88. #define DOT_6DEGREE 0.9945218953683
  89. #define DOT_7DEGREE 0.9925461516413
  90. #define DOT_8DEGREE 0.9902680687416
  91. #define DOT_9DEGREE 0.9876883405951
  92. #define DOT_10DEGREE 0.9848077530122
  93. #define DOT_15DEGREE 0.9659258262891
  94. #define DOT_20DEGREE 0.9396926207859
  95. #define DOT_25DEGREE 0.9063077870367
  96. #define DOT_30DEGREE 0.866025403784
  97. #define DOT_45DEGREE 0.707106781187
  98. //#define DEBUG_MOTION_CONTROLLERS //uncomment to spew debug data while in a motion controller
  99. enum HltvUiType_t
  100. {
  101. HLTV_UI_XRAY_ON = 0,
  102. HLTV_UI_XRAY_OFF,
  103. HLTV_UI_SCOREBOARD_ON,
  104. HLTV_UI_SCOREBOARD_OFF,
  105. HLTV_UI_OVERVIEW_ON,
  106. HLTV_UI_OVERVIEW_OFF,
  107. HLTV_UI_GRAPHS_ON,
  108. HLTV_UI_GRAPHS_OFF
  109. };
  110. // Shared header file for players
  111. #if defined( CLIENT_DLL )
  112. #define CBasePlayer C_BasePlayer
  113. #include "c_baseplayer.h"
  114. #else
  115. #include "player.h"
  116. #endif
  117. #endif // BASEPLAYER_SHARED_H