summaryrefslogtreecommitdiff
path: root/game/shared/tf2/tf_playeranimstate.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/tf2/tf_playeranimstate.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/tf2/tf_playeranimstate.h')
-rw-r--r--game/shared/tf2/tf_playeranimstate.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/game/shared/tf2/tf_playeranimstate.h b/game/shared/tf2/tf_playeranimstate.h
new file mode 100644
index 0000000..9dcd249
--- /dev/null
+++ b/game/shared/tf2/tf_playeranimstate.h
@@ -0,0 +1,76 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef TF_PLAYERANIMSTATE_H
+#define TF_PLAYERANIMSTATE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "studio.h"
+
+#if defined( CLIENT_DLL )
+#define CBaseTFPlayer C_BaseTFPlayer
+#endif
+
+class CPlayerAnimState
+{
+public:
+ enum
+ {
+ TURN_NONE = 0,
+ TURN_LEFT,
+ TURN_RIGHT
+ };
+
+ CPlayerAnimState( CBaseTFPlayer *outer );
+
+ Activity BodyYawTranslateActivity( Activity activity );
+
+ void Update();
+
+ const QAngle& GetRenderAngles();
+
+ void GetPoseParameters( float poseParameter[MAXSTUDIOPOSEPARAM] );
+
+ CBaseTFPlayer *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( void );
+ void ComputePoseParam_BodyLookYaw( void );
+
+ void ComputePlaybackRate();
+
+ CBaseTFPlayer *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;
+};
+#endif // TF_PLAYERANIMSTATE_H