BVB Source Codes

CRYENGINE Show VehicleAnimation.h Source code

Return Download CRYENGINE: download VehicleAnimation.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.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 22:03:2006: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEANIMATION_H__
  15. #define __VEHICLEANIMATION_H__
  16.  
  17. #include <IVehicleSystem.h>
  18.  
  19. class CVehiclePartAnimated;
  20.  
  21. class CVehicleAnimation : public IVehicleAnimation
  22. {
  23. public:
  24.  
  25.         CVehicleAnimation();
  26.         virtual ~CVehicleAnimation() {}
  27.  
  28.         virtual bool                Init(IVehicle* pVehicle, const CVehicleParams& table);
  29.         virtual void                Reset();
  30.         virtual void                Release() { delete this; }
  31.  
  32.         virtual bool                StartAnimation();
  33.         virtual void                StopAnimation();
  34.  
  35.         virtual bool                ChangeState(TVehicleAnimStateId stateId);
  36.         virtual TVehicleAnimStateId GetState();
  37.  
  38.         virtual string              GetStateName(TVehicleAnimStateId stateId);
  39.         virtual TVehicleAnimStateId GetStateId(const string& name);
  40.  
  41.         virtual void                SetSpeed(float speed);
  42.  
  43.         virtual void                ToggleManualUpdate(bool isEnabled);
  44.         virtual void                SetTime(float time, bool force = false);
  45.  
  46.         virtual float               GetAnimTime(bool raw = false);
  47.         virtual bool                IsUsingManualUpdates();
  48.  
  49.         virtual void                GetMemoryUsage(ICrySizer* pSizer) const
  50.         {
  51.                 pSizer->AddObject(m_animationStates);
  52.         }
  53. protected:
  54.  
  55.         struct SAnimationStateMaterial
  56.         {
  57.                 string material, setting;
  58.                 float  _min, _max;
  59.                 bool   invertValue;
  60.  
  61.                 void   GetMemoryUsage(ICrySizer* pSizer) const
  62.                 {
  63.                         pSizer->AddObject(material);
  64.                         pSizer->AddObject(setting);
  65.                 }
  66.         };
  67.  
  68.         typedef std::vector<SAnimationStateMaterial> TAnimationStateMaterialVector;
  69.  
  70.         struct SAnimationState
  71.         {
  72.                 string                        name;
  73.                 string                        animation;
  74.  
  75.                 string                        sound;
  76.                 //tSoundID soundId;
  77.                 IVehicleHelper*               pSoundHelper;
  78.  
  79.                 float                         speedDefault;
  80.                 float                         speedMin;
  81.                 float                         speedMax;
  82.                 bool                          isLooped;
  83.                 bool                          isLoopedEx;
  84.  
  85.                 TAnimationStateMaterialVector materials;
  86.  
  87.                 void                          GetMemoryUsage(ICrySizer* pSizer) const
  88.                 {
  89.                         pSizer->AddObject(name);
  90.                         pSizer->AddObject(animation);
  91.                         pSizer->AddObject(sound);
  92.                         pSizer->AddObject(pSoundHelper);
  93.                         pSizer->AddObject(materials);
  94.                 }
  95.         };
  96.  
  97.         typedef std::vector<SAnimationState> TAnimationStateVector;
  98.  
  99. protected:
  100.  
  101.         bool       ParseState(const CVehicleParams& table, IVehicle* pVehicle);
  102.         IMaterial* FindMaterial(const SAnimationStateMaterial& animStateMaterial, IMaterial* pMaterial);
  103.  
  104.         CVehiclePartAnimated* m_pPartAnimated;
  105.         int                   m_layerId;
  106.  
  107.         TAnimationStateVector m_animationStates;
  108.         TVehicleAnimStateId   m_currentStateId;
  109.  
  110.         bool                  m_currentAnimIsWaiting;
  111. };
  112.  
  113. #endif
  114.  
downloadVehicleAnimation.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