BVB Source Codes

CRYENGINE Show VehicleSeatActionSteeringWheel.h Source code

Return Download CRYENGINE: download VehicleSeatActionSteeringWheel.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 seat action for the steering wheel
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 28:11:2005: Created by Mathieu Pinard
  12.    - 14:06:2012: Refactored to work with CryMannequin by Benito Gangoso Rodriguez
  13.  
  14. *************************************************************************/
  15. #ifndef __VEHICLESEATACTIONSTEERINGWHEEL_H__
  16. #define __VEHICLESEATACTIONSTEERINGWHEEL_H__
  17.  
  18. #include <SharedParams/ISharedParams.h>
  19. #include "VehicleNoiseGenerator.h"
  20.  
  21. class CVehiclePartAnimatedJoint;
  22. class CVehiclePartSubPartWheel;
  23.  
  24. class CVehicleSeatActionSteeringWheel
  25.         : public IVehicleSeatAction
  26. {
  27.         IMPLEMENT_VEHICLEOBJECT
  28.  
  29. private:
  30.         enum ESteeringClass
  31.         {
  32.                 eSC_Generic = 1,
  33.                 eSC_Car,
  34.         };
  35.  
  36. public:
  37.  
  38.         CVehicleSeatActionSteeringWheel();
  39.         virtual ~CVehicleSeatActionSteeringWheel() { Reset(); }
  40.  
  41.         // IVehicleSeatAction
  42.         virtual bool Init(IVehicle* pVehicle, IVehicleSeat* pSeat, const CVehicleParams& table) override;
  43.         virtual void Reset() override;
  44.         virtual void Release() override { delete this; }
  45.  
  46.         virtual void StartUsing(EntityId passengerId) override;
  47.         virtual void ForceUsage() override {}
  48.         virtual void StopUsing() override;
  49.         virtual void OnAction(const TVehicleActionId actionId, int activationMode, float value) override;
  50.  
  51.         virtual void Serialize(TSerialize ser, EEntityAspects aspects) override;
  52.         virtual void PostSerialize() override;
  53.         virtual void Update(const float deltaTime) override;
  54.  
  55.         virtual void GetMemoryUsage(ICrySizer* s) const override { s->Add(*this); }
  56.         // ~IVehicleSeatAction
  57.  
  58.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) override {}
  59.  
  60. protected:
  61.  
  62.         BEGIN_SHARED_PARAMS(SSharedParams)
  63.  
  64.         ESteeringClass steeringClass;
  65.         float steeringRelaxMult;
  66.         float steeringForce;
  67.  
  68.         float jitterAmpLow;           // amplitude of jitter at low speed
  69.         float jitterAmpHi;            // amplitude of jitter at high speed
  70.         float jitterFreqLow;          // frequency at low speed
  71.         float jitterFreqHi;           // frequency at high speed/high accel
  72.         float jitterSuspAmp;          // max amplitude due to suspension changes
  73.         float jitterSuspResponse;     // suspension response
  74.  
  75.         END_SHARED_PARAMS
  76.  
  77.         IVehicle*             m_pVehicle;
  78.  
  79.         SSharedParamsConstPtr m_pSharedParams;
  80.  
  81.         // car based steering
  82.         float m_wheelInvRotationMax;
  83.         float m_currentSteering;
  84.  
  85.         // generic (non car) steering
  86.         Vec3               m_steeringActions;
  87.         Vec3               m_steeringValues;
  88.  
  89.         EntityId           m_userId;
  90.         bool               m_isBeingUsed;
  91.         bool               m_isUsedSerialization;
  92.  
  93.         CVehicleNoiseValue m_jitter;
  94.         float              m_jitterOffset;
  95.         float              m_jitterSuspensionResponse;
  96.  
  97. };
  98.  
  99. #endif
  100.  
downloadVehicleSeatActionSteeringWheel.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