BVB Source Codes

CRYENGINE Show VehicleViewBase.h Source code

Return Download CRYENGINE: download VehicleViewBase.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: Implements a base class for the vehicle views
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 06:07:2006: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEVIEWBASE_H__
  15. #define __VEHICLEVIEWBASE_H__
  16.  
  17. class CVehicleSeat;
  18.  
  19. class CVehicleViewBase
  20.         : public IVehicleView
  21. {
  22. public:
  23.  
  24.         CVehicleViewBase();
  25.  
  26.         // IVehicleView
  27.         virtual bool        Init(IVehicleSeat* pSeat, const CVehicleParams& table);
  28.         virtual void        Reset();
  29.         virtual void        ResetPosition() {};
  30.         virtual void        Release()       { delete this; }
  31.  
  32.         virtual const char* GetName()       { return NULL; }
  33.  
  34.         virtual bool        IsThirdPerson() = 0;
  35.         virtual bool        IsPassengerHidden()      { return m_hidePlayer; }
  36.  
  37.         virtual bool        IsEnabled() const        { return m_isEnabled; }
  38.         virtual void        SetEnabled(bool enabled) { m_isEnabled = enabled; }
  39.  
  40.         virtual void        OnStartUsing(EntityId passengerId);
  41.         virtual void        OnStopUsing();
  42.  
  43.         virtual void        OnAction(const TVehicleActionId actionId, int activationMode, float value);
  44.         virtual void        UpdateView(SViewParams& viewParams, EntityId playerId) {}
  45.  
  46.         virtual void        Update(const float frameTime);
  47.         virtual void Serialize(TSerialize serialize, EEntityAspects);
  48.  
  49.         virtual void SetDebugView(bool debug)    { m_isDebugView = debug; }
  50.         virtual bool IsDebugView()               { return m_isDebugView; }
  51.  
  52.         virtual bool ShootToCrosshair()          { return true; }
  53.         virtual bool IsAvailableRemotely() const { return m_isAvailableRemotely; }
  54.         // ~IVehicleView
  55.  
  56.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) {}
  57.  
  58.         bool         Init(CVehicleSeat* pSeat);
  59.  
  60. protected:
  61.  
  62.         IVehicle*     m_pVehicle;
  63.         CVehicleSeat* m_pSeat;
  64.  
  65.         // view settings (changed only inside Init)
  66.  
  67.         bool  m_isRotating;
  68.  
  69.         Vec3  m_rotationMin;
  70.         Vec3  m_rotationMax;
  71.         Vec3  m_rotationInit;
  72.         float m_relaxDelayMax;
  73.         float m_relaxTimeMax;
  74.         float m_velLenMin;
  75.         float m_velLenMax;
  76.  
  77.         bool  m_isSendingActionOnRotation;
  78.         float m_rotationBoundsActionMult;
  79.  
  80.         // status variables (changed during run-time)
  81.  
  82.         Ang3  m_rotation;
  83.         Vec3  m_rotatingAction;
  84.         Ang3  m_viewAngleOffset;
  85.  
  86.         Vec3  m_rotationCurrentSpeed;
  87.         float m_rotationValRateX;  // used for SmoothCD call on the rotation
  88.         float m_rotationValRateZ;
  89.         float m_rotationTimeAcc;
  90.         float m_rotationTimeDec;
  91.  
  92.         bool  m_isRelaxEnabled;
  93.         float m_relaxDelay;
  94.         float m_relaxTime;
  95.  
  96.         int   m_yawLeftActionOnBorderAAM;
  97.         int   m_yawRightActionOnBorderAAM;
  98.         int   m_pitchUpActionOnBorderAAM;
  99.         int   m_pitchDownActionOnBorderAAM;
  100.  
  101.         float m_pitchVal;
  102.         float m_yawVal;
  103.  
  104.         struct SViewGeneratedAction
  105.         {
  106.                 TVehicleActionId actionId;
  107.                 int              activationMode;
  108.         };
  109.  
  110.         bool m_hidePlayer;
  111.         bool m_isEnabled;
  112.         bool m_isDebugView;
  113.         bool m_isAvailableRemotely;
  114.         bool m_playerViewThirdOnExit;
  115.  
  116.         typedef std::vector<string> TVehiclePartNameVector;
  117.         TVehiclePartNameVector m_hideParts;
  118. };
  119.  
  120. #endif
  121.  
downloadVehicleViewBase.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top