BVB Source Codes

CRYENGINE Show VehicleViewThirdPerson.h Source code

Return Download CRYENGINE: download VehicleViewThirdPerson.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 third person view for vehicles
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 02:05:2005: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEVIEWTHIRDPERSON_H__
  15. #define __VEHICLEVIEWTHIRDPERSON_H__
  16.  
  17. #include "VehicleViewBase.h"
  18.  
  19. class CVehicleViewThirdPerson
  20.         : public CVehicleViewBase
  21. {
  22.         IMPLEMENT_VEHICLEOBJECT;
  23. public:
  24.  
  25.         CVehicleViewThirdPerson();
  26.         ~CVehicleViewThirdPerson();
  27.  
  28.         // IVehicleView
  29.         virtual bool Init(IVehicleSeat* pSeat, const CVehicleParams& table) override;
  30.         virtual void Reset() override;
  31.         virtual void ResetPosition() override
  32.         {
  33.                 m_position = m_pVehicle->GetEntity()->GetWorldPos();
  34.         }
  35.  
  36.         virtual const char* GetName() override           { return m_name; }
  37.         virtual bool        IsThirdPerson() override     { return true; }
  38.         virtual bool        IsPassengerHidden() override { return false; }
  39.  
  40.         virtual void        OnAction(const TVehicleActionId actionId, int activationMode, float value) override;
  41.         virtual void        UpdateView(SViewParams& viewParams, EntityId playerId) override;
  42.  
  43.         virtual void        OnStartUsing(EntityId passengerId) override;
  44.  
  45.         virtual void        Update(const float frameTime) override;
  46.         virtual void Serialize(TSerialize serialize, EEntityAspects) override;
  47.  
  48.         virtual bool ShootToCrosshair() override { return false; }
  49.  
  50.         virtual void OffsetPosition(const Vec3& delta) override;
  51.         // ~IVehicleView
  52.  
  53.         bool Init(CVehicleSeat* pSeat);
  54.  
  55.         //! sets default view distance. if 0, the distance from the vehicle is used
  56.         static void SetDefaultDistance(float dist);
  57.  
  58.         //! sets default height offset. if 0, the heightOffset from the vehicle is used
  59.         static void SetDefaultHeight(float height);
  60.  
  61.         void        GetMemoryUsage(ICrySizer* s) const override { s->Add(*this); }
  62.  
  63. protected:
  64.  
  65.         I3DEngine*         m_p3DEngine;
  66.         IEntitySystem*     m_pEntitySystem;
  67.  
  68.         EntityId           m_targetEntityId;
  69.         IVehiclePart*      m_pAimPart;
  70.  
  71.         float              m_distance;
  72.         float              m_heightOffset;
  73.  
  74.         float              m_height;
  75.         Vec3               m_vehicleCenter;
  76.  
  77.         static const char* m_name;
  78.  
  79.         Vec3               m_position;
  80.         Vec3               m_worldPos;
  81.         float              m_rot;
  82.  
  83.         float              m_interpolationSpeed;
  84.         float              m_boundSwitchAngle;
  85.         float              m_zoom;
  86.         float              m_zoomMult;
  87.  
  88.         static float       m_defaultDistance;
  89.         static float       m_defaultHeight;
  90.  
  91.         float              m_actionZoom;
  92.         float              m_actionZoomSpeed;
  93.  
  94.         bool               m_isUpdatingPos;
  95. };
  96.  
  97. #endif
  98.  
downloadVehicleViewThirdPerson.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