aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/shared/hl2mp/hl2mp_player_shared.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/shared/hl2mp/hl2mp_player_shared.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/shared/hl2mp/hl2mp_player_shared.h')
-rw-r--r--sp/src/game/shared/hl2mp/hl2mp_player_shared.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/sp/src/game/shared/hl2mp/hl2mp_player_shared.h b/sp/src/game/shared/hl2mp/hl2mp_player_shared.h
new file mode 100644
index 00000000..daaaebdf
--- /dev/null
+++ b/sp/src/game/shared/hl2mp/hl2mp_player_shared.h
@@ -0,0 +1,97 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+#ifndef HL2MP_PLAYER_SHARED_H
+#define HL2MP_PLAYER_SHARED_H
+#pragma once
+
+#define HL2MP_PUSHAWAY_THINK_INTERVAL (1.0f / 20.0f)
+#include "studio.h"
+
+
+enum
+{
+ PLAYER_SOUNDS_CITIZEN = 0,
+ PLAYER_SOUNDS_COMBINESOLDIER,
+ PLAYER_SOUNDS_METROPOLICE,
+ PLAYER_SOUNDS_MAX,
+};
+
+enum HL2MPPlayerState
+{
+ // Happily running around in the game.
+ STATE_ACTIVE=0,
+ STATE_OBSERVER_MODE, // Noclipping around, watching players, etc.
+ NUM_PLAYER_STATES
+};
+
+
+#if defined( CLIENT_DLL )
+#define CHL2MP_Player C_HL2MP_Player
+#endif
+
+class CPlayerAnimState
+{
+public:
+ enum
+ {
+ TURN_NONE = 0,
+ TURN_LEFT,
+ TURN_RIGHT
+ };
+
+ CPlayerAnimState( CHL2MP_Player *outer );
+
+ Activity BodyYawTranslateActivity( Activity activity );
+
+ void Update();
+
+ const QAngle& GetRenderAngles();
+
+ void GetPoseParameters( CStudioHdr *pStudioHdr, float poseParameter[MAXSTUDIOPOSEPARAM] );
+
+ CHL2MP_Player *GetOuter();
+
+private:
+ void GetOuterAbsVelocity( Vector& vel );
+
+ int ConvergeAngles( float goal,float maxrate, float dt, float& current );
+
+ void EstimateYaw( void );
+ void ComputePoseParam_BodyYaw( void );
+ void ComputePoseParam_BodyPitch( CStudioHdr *pStudioHdr );
+ void ComputePoseParam_BodyLookYaw( void );
+
+ void ComputePlaybackRate();
+
+ CHL2MP_Player *m_pOuter;
+
+ float m_flGaitYaw;
+ float m_flStoredCycle;
+
+ // The following variables are used for tweaking the yaw of the upper body when standing still and
+ // making sure that it smoothly blends in and out once the player starts moving
+ // Direction feet were facing when we stopped moving
+ float m_flGoalFeetYaw;
+ float m_flCurrentFeetYaw;
+
+ float m_flCurrentTorsoYaw;
+
+ // To check if they are rotating in place
+ float m_flLastYaw;
+ // Time when we stopped moving
+ float m_flLastTurnTime;
+
+ // One of the above enums
+ int m_nTurningInPlace;
+
+ QAngle m_angRender;
+
+ float m_flTurnCorrectionTime;
+};
+
+#endif //HL2MP_PLAYER_SHARED_h