psy_commando

c_prop_sfr_vehicle.h

Apr 28th, 2012
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.77 KB | None | 0 0
  1. #ifndef C_PROP_SFR_VEHICLE_H
  2. #define C_PROP_SFR_VEHICLE_H
  3. /*
  4. */
  5. #include "IClientVehicle.h"
  6. #include "c_physicsprop.h"
  7. #include "vehicle_viewblend_shared.h"
  8. #include "physpropclientside.h"
  9.  
  10. class C_PropSFRVehicle : public C_BaseAnimating/*C_PhysicsPropMultiplayer*/, public IClientVehicle
  11. {
  12.     DECLARE_CLASS( C_PropSFRVehicle, C_BaseAnimating/*C_PhysicsPropMultiplayer*/ );
  13.  
  14. public:
  15.     DECLARE_CLIENTCLASS();
  16.     //DECLARE_DATADESC();
  17.  
  18.    C_PropSFRVehicle();
  19.  
  20. // C_BaseEntity overrides.
  21. public:
  22.     virtual ShadowType_t ShadowCastType();
  23.     virtual void ClientThink( void );
  24.  
  25. // IVehicle overrides.
  26. public:
  27.    virtual IClientVehicle*  GetClientVehicle() { return this; }
  28.     virtual C_BaseCombatCharacter* GetPassenger( int nRole );
  29.     virtual int GetPassengerRole( C_BaseCombatCharacter *pEnt );
  30.     virtual bool IsPassengerUsingStandardWeapons( int nRole = VEHICLE_ROLE_DRIVER ) { return false; }
  31.    virtual void SetupMove( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move ) { DriveVehicle( TICK_INTERVAL, ucmd, player->m_afButtonPressed, player->m_afButtonReleased );  }
  32.     virtual void ProcessMovement( C_BasePlayer *pPlayer, CMoveData *pMoveData ) {}
  33.     virtual void FinishMove( C_BasePlayer *player, CUserCmd *ucmd, CMoveData *move ) {}
  34.    virtual void ItemPostFrame( C_BasePlayer *pPlayer ){}
  35.  
  36.    virtual void GetVehicleViewPosition( int nRole, Vector *pOrigin, QAngle *pAngles, float *pFOV = NULL );
  37.  
  38.  
  39. // IClientVehicle overrides.
  40. public:
  41.    virtual void GetVehicleFOV( float &flFOV ) {flFOV = 75.0f;}
  42.     virtual void UpdateViewAngles( C_BasePlayer *pLocalPlayer, CUserCmd *pCmd );
  43.     virtual void DrawHudElements();
  44.    virtual bool IsPredicted() const {return true;}
  45.     virtual C_BaseEntity *GetVehicleEnt() { return this; }
  46.     virtual void GetVehicleClipPlanes( float &flZNear, float &flZFar ) const;
  47.     virtual int GetJoystickResponseCurve() const;
  48.  
  49.  
  50. //C_PropSFRVehicle
  51. protected:
  52.    virtual void OnEnteredVehicle( C_BaseCombatCharacter *pPassenger );
  53.    virtual void DriveVehicle( float flFrameTime, CUserCmd *ucmd, int iButtonsDown, int iButtonsReleased ){} // Driving Button handling
  54.  
  55.    //On/Off
  56.    void TurnOn(){ m_bIsOn = true; }
  57.    void TurnOff(){ m_bIsOn = false; }
  58.    bool IsOn(){return m_bIsOn;}
  59.  
  60. protected:
  61.    CHandle<C_BasePlayer>        m_hPlayer;
  62.    bool m_bIsOn;
  63. };
  64.  
  65. class C_PropSFRVehicleWithViewSmoothing : public C_PropSFRVehicle
  66. {
  67. public:
  68.    DECLARE_CLASS( C_PropSFRVehicleWithViewSmoothing, C_PropSFRVehicle );
  69.    DECLARE_DATADESC();
  70.  
  71.    C_PropSFRVehicleWithViewSmoothing();
  72.    virtual void GetVehicleViewPosition( int nRole, Vector *pOrigin, QAngle *pAngles, float *pFOV = NULL );
  73.  
  74.    virtual void DampenEyePosition( Vector &vecVehicleEyePos, QAngle &vecVehicleEyeAngles );
  75.  
  76. protected:
  77.    ViewSmoothingData_t m_ViewSmoothingData;
  78. };
  79.  
  80. #endif
Advertisement
Add Comment
Please, Sign In to add comment