diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/weapon_ifmsteadycam.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/weapon_ifmsteadycam.h')
| -rw-r--r-- | game/shared/weapon_ifmsteadycam.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/game/shared/weapon_ifmsteadycam.h b/game/shared/weapon_ifmsteadycam.h new file mode 100644 index 0000000..98f32ba --- /dev/null +++ b/game/shared/weapon_ifmsteadycam.h @@ -0,0 +1,106 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//===========================================================================// + +#ifndef WEAPON_IFMSTEADYCAM_H +#define WEAPON_IFMSTEADYCAM_H +#ifdef _WIN32 +#pragma once +#endif + +#include "weapon_ifmbasecamera.h" + +#if defined( CLIENT_DLL ) + #define CWeaponIFMSteadyCam C_WeaponIFMSteadyCam +#endif + +class CWeaponIFMSteadyCam : public CWeaponIFMBaseCamera +{ +public: + DECLARE_CLASS( CWeaponIFMSteadyCam, CWeaponIFMBaseCamera ); + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + +#ifdef GAME_DLL + DECLARE_DATADESC(); +#endif + +public: + // Shared code + CWeaponIFMSteadyCam(); + virtual ~CWeaponIFMSteadyCam(); + + virtual void ItemPostFrame(); + +private: + +#ifdef CLIENT_DLL + +public: + // Client code + virtual void CreateMove( float flInputSampleTime, CUserCmd *pCmd, const QAngle &vecOldViewAngles ); + virtual void DrawCrosshair( void ); + virtual void GetToolRecordingState( KeyValues *msg ); + +private: + // Purpose: Draw the weapon's crosshair + void DrawArmLength( int x, int y, int w, int h, Color clr ); + void DrawFOV( int x, int y, int w, int h, Color clrEdges, Color clrTriangle ); + + // Transmits the lock target + void TransmitLockTarget(); + + // Updates the relative orientation of the camera + void UpdateRelativeOrientation(); + void UpdateLockedRelativeOrientation(); + void UpdateDirectRelativeOrientation(); + + // Computes a matrix given a forward direction + void MatrixFromForwardDirection( const Vector &vecForward, matrix3x4_t &mat ); + + // Targets the camera to always look at a point + void LockCamera(); + + // Toggles to springy camera + void ToggleSpringCamera(); + void ToggleDirectMode(); + + // Compute the location of the camera for rendering + virtual void ComputeAbsCameraTransform( Vector &origin, QAngle &angles ); + + // Updates the relative orientation of the camera, spring mode + void ComputeMouseRay( const VMatrix &steadyCamToPlayer, Vector &vecForward ); + + // Updates the 2d spring + void ComputeViewOffset(); + + bool m_bIsLocked; + bool m_bInDirectMode; + bool m_bInSpringMode; + Vector m_vecOffset; + + Vector m_vec2DVelocity; + Vector m_vecActualViewOffset; + Vector m_vecViewOffset; + float m_flFOVOffsetY; + + vgui::HFont m_hFont; + int m_nTextureId; +#endif // CLIENT_DLL + +#ifdef GAME_DLL +public: + // Server code +#endif // GAME_DLL + +private: + EHANDLE m_hLockTarget; + +private: + CWeaponIFMSteadyCam( const CWeaponIFMSteadyCam & ); +}; + + +#endif // WEAPON_IFMSTEADYCAM_H |