BVB Source Codes

CRYENGINE Show VehicleViewSteer.h Source code

Return Download CRYENGINE: download VehicleViewSteer.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.    - Created by Rich Semmens/Stan Fichele
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEVIEWSTEER_H__
  15. #define __VEHICLEVIEWSTEER_H__
  16.  
  17. #include "VehicleViewBase.h"
  18.  
  19. enum EVehicleViewSteerFlags
  20. {
  21.         eVCam_rotationClamp  = 1 << 0,        // Clamp any rotation
  22.         eVCam_rotationSpring = 1 << 1,        // Allow spring relaxation to default position
  23.         eVCam_goingForwards  = 1 << 2,        // Direction of travel
  24.         eVCam_canRotate      = 1 << 3,        // Use input to rotate camera
  25. };
  26.  
  27. class CVehicleViewSteer
  28.         : public CVehicleViewBase
  29. {
  30.         IMPLEMENT_VEHICLEOBJECT;
  31. public:
  32.  
  33.         CVehicleViewSteer();
  34.         virtual ~CVehicleViewSteer();
  35.  
  36.         // IVehicleView
  37.         virtual bool Init(IVehicleSeat* pSeat, const CVehicleParams& table) override;
  38.         virtual void Reset() override;
  39.         virtual void ResetPosition() override
  40.         {
  41.                 m_position = m_pVehicle->GetEntity()->GetWorldPos();
  42.         }
  43.  
  44.         virtual const char* GetName() override           { return m_name; }
  45.         virtual bool        IsThirdPerson() override     { return true; }
  46.         virtual bool        IsPassengerHidden() override { return false; }
  47.  
  48.         virtual void        OnAction(const TVehicleActionId actionId, int activationMode, float value) override;
  49.         virtual void        UpdateView(SViewParams& viewParams, EntityId playerId) override;
  50.  
  51.         virtual void        OnStartUsing(EntityId passengerId) override;
  52.         virtual void        OnStopUsing() override;
  53.  
  54.         virtual void        Update(const float frameTime) override;
  55.         virtual void Serialize(TSerialize serialize, EEntityAspects) override;
  56.  
  57.         virtual bool ShootToCrosshair() override { return false; }
  58.         virtual void OffsetPosition(const Vec3& delta) override;
  59.         // ~IVehicleView
  60.  
  61.         bool         Init(CVehicleSeat* pSeat);
  62.         void         CalcLookAt(const Matrix34& entityTM);
  63.  
  64.         virtual void GetMemoryUsage(ICrySizer* s) const override { s->Add(*this); }
  65.  
  66. protected:
  67.         IVehiclePart*      m_pAimPart;
  68.  
  69.         Vec3               m_maxRotation;
  70.         Vec3               m_maxRotation2;
  71.         Vec3               m_stickSensitivity;
  72.         Vec3               m_stickSensitivity2;
  73.  
  74.         static const char* m_name;
  75.  
  76.         Vec3               m_position;
  77.         Vec3               m_localSpaceCameraOffset;
  78.         Vec3               m_lastOffsetBeforeElev;
  79.         Vec3               m_lastOffset;
  80.         Vec3               m_lookAt0;
  81.         Vec3               m_lookAt;
  82.         Vec3               m_lastVehVel;
  83.  
  84.         int                m_flags; /* EVehicleViewSteerFlags */
  85.         int                m_forwardFlags;
  86.         int                m_backwardsFlags;
  87.  
  88.         float              m_angReturnSpeed1;
  89.         float              m_angReturnSpeed2;
  90.         float              m_angReturnSpeed;
  91.         float              m_curYaw;
  92.  
  93.         float              m_angSpeedCorrection0;
  94.         float              m_angSpeedCorrection;
  95.         float              m_radius;
  96.         float              m_radiusVel;          // Velocity change of radius
  97.         float              m_radiusRelaxRate;    // Relax spring to default radius
  98.         float              m_radiusDampRate;     // Damp the velocity change of the radius
  99.         float              m_radiusVelInfluence; // How much the vehicle velocity influences the camera distance/radius
  100.         float              m_radiusMin;
  101.         float              m_radiusMax;
  102.         float              m_inheritedElev;
  103.         float              m_pivotOffset;
  104. };
  105.  
  106. #endif
  107.  
downloadVehicleViewSteer.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