BVB Source Codes

CRYENGINE Show VehicleSeatActionShakeParts.h Source code

Return Download CRYENGINE: download VehicleSeatActionShakeParts.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:
  8.    Implements a seat action for shaking a list of parts based on
  9.    vehicle movement, speed and acceleration
  10.  
  11.    -------------------------------------------------------------------------
  12.    History:
  13.    - Created by Stan Fichele
  14.  
  15. *************************************************************************/
  16.  
  17. #ifndef __VEHICLESEATACTION_SHAKE_PARTS__H__
  18. #define __VEHICLESEATACTION_SHAKE_PARTS__H__
  19.  
  20. #include <SharedParams/ISharedParams.h>
  21. #include "VehicleNoiseGenerator.h"
  22.  
  23. class CVehicleSeatActionShakeParts
  24.         : public IVehicleSeatAction
  25. {
  26.         IMPLEMENT_VEHICLEOBJECT
  27.  
  28. public:
  29.  
  30.         CVehicleSeatActionShakeParts();
  31.  
  32.         virtual bool Init(IVehicle* pVehicle, IVehicleSeat* pSeat, const CVehicleParams& table) override;
  33.         virtual void Reset() override   {}
  34.         virtual void Release() override { delete this; }
  35.  
  36.         virtual void StartUsing(EntityId passengerId) override;
  37.         virtual void ForceUsage() override                                                               {}
  38.         virtual void StopUsing() override;
  39.         virtual void OnAction(const TVehicleActionId actionId, int activationMode, float value) override {}
  40.  
  41.         virtual void Serialize(TSerialize ser, EEntityAspects aspects) override                          {}
  42.         virtual void PostSerialize() override                                                            {}
  43.         virtual void Update(const float deltaTime) override;
  44.  
  45.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) override {}
  46.  
  47.         virtual void GetMemoryUsage(ICrySizer* s) const override;
  48.  
  49. protected:
  50.  
  51.         BEGIN_SHARED_PARAMS(SSharedParams)
  52.  
  53.         struct SPartInfo
  54.         {
  55.                 unsigned int partIndex;
  56.                 float        amplitudeUpDown;
  57.                 float        amplitudeRot;
  58.                 float        freq;
  59.                 float        suspensionAmp;
  60.                 float        suspensionResponse;
  61.                 float        suspensionSharpness;
  62.         };
  63.         typedef std::vector<SPartInfo> TPartInfos;
  64.         typedef const TPartInfos       TPartInfosConst;
  65.         TPartInfos partInfos;
  66.  
  67.         END_SHARED_PARAMS
  68.  
  69.         struct SPartInstance
  70.         {
  71.                 // Updated at runtime
  72.                 CVehicleNoiseValue noiseUpDown;
  73.                 CVehicleNoiseValue noiseRot;
  74.                 float              zpos;
  75.         };
  76.  
  77.         typedef std::vector<SPartInstance> TParts;
  78.         IVehicle*             m_pVehicle;
  79.         TParts                m_controlledParts;
  80.         SSharedParamsConstPtr m_pSharedParams;
  81. };
  82.  
  83. #endif //__VEHICLESEATACTION_SHAKE_PARTS__H__
  84.  
downloadVehicleSeatActionShakeParts.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