BVB Source Codes

CRYENGINE Show VehicleViewActionThirdPerson.h Source code

Return Download CRYENGINE: download VehicleViewActionThirdPerson.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 tweaked for
  8.    action gameplay
  9.  
  10.    -------------------------------------------------------------------------
  11.    History:
  12.    - 18:08:2006: Created by Mathieu Pinard
  13.  
  14. *************************************************************************/
  15. #ifndef __VEHICLEVIEWACTIONTHIRDPERSON_H__
  16. #define __VEHICLEVIEWACTIONTHIRDPERSON_H__
  17.  
  18. #include "VehicleViewBase.h"
  19.  
  20. class CVehicleViewActionThirdPerson
  21.         : public CVehicleViewBase
  22. {
  23.         IMPLEMENT_VEHICLEOBJECT;
  24. public:
  25.  
  26.         CVehicleViewActionThirdPerson();
  27.         ~CVehicleViewActionThirdPerson();
  28.  
  29.         // IVehicleView
  30.         virtual bool Init(IVehicleSeat* pSeat, const CVehicleParams& table) override;
  31.         virtual void Reset() override;
  32.         virtual void ResetPosition() override
  33.         {
  34.                 m_worldCameraPos = m_pVehicle->GetEntity()->GetWorldPos();
  35.                 m_worldViewPos = m_worldCameraPos;
  36.         }
  37.  
  38.         virtual const char* GetName() override           { return m_name; }
  39.         virtual bool        IsThirdPerson() override     { return true; }
  40.         virtual bool        IsPassengerHidden() override { return false; }
  41.  
  42.         virtual void        OnStartUsing(EntityId passengerId) override;
  43.  
  44.         virtual void        OnAction(const TVehicleActionId actionId, int activationMode, float value) override;
  45.         virtual void        UpdateView(SViewParams& viewParams, EntityId playerId) override;
  46.  
  47.         virtual void        Update(const float frameTime) override;
  48.         virtual void Serialize(TSerialize serialize, EEntityAspects) override;
  49.  
  50.         virtual void GetMemoryUsage(ICrySizer* s) const override { s->Add(*this); }
  51.  
  52.         virtual void OffsetPosition(const Vec3& delta) override;
  53.         // ~IVehicleView
  54.  
  55. protected:
  56.  
  57.         Matrix34 GetCameraTM(const Matrix34& worldTM, const Vec3& aimPos);
  58.         Vec3     GetAimPos(const Matrix34& worldTM);
  59.  
  60.         Vec3               m_worldViewPos;
  61.         Vec3               m_worldCameraPos;
  62.         Vec3               m_worldCameraAim;
  63.  
  64.         IVehiclePart*      m_pAimPart;
  65.  
  66.         Vec3               m_localCameraPos;
  67.         Vec3               m_localCameraAim;
  68.         Vec3               m_velocityMult;
  69.         float              m_lagSpeed;
  70.  
  71.         Vec3               m_extraLag;
  72.  
  73.         float              m_zoom;
  74.         float              m_zoomTarget;
  75.         float              m_actionZoom;
  76.         float              m_verticalFilter;
  77.         float              m_verticalFilterOffset;
  78.  
  79.         float              m_heightAboveWater;
  80.  
  81.         Vec3               m_cameraOffset;
  82.  
  83.         static const char* m_name;
  84. };
  85.  
  86. #endif
  87.  
downloadVehicleViewActionThirdPerson.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