BVB Source Codes

CRYENGINE Show VehicleDamageBehaviorIndicator.h Source code

Return Download CRYENGINE: download VehicleDamageBehaviorIndicator.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __VEHICLEDAMAGEBEHAVIORINDICATOR_H__
  4. #define __VEHICLEDAMAGEBEHAVIORINDICATOR_H__
  5.  
  6. #include "IVehicleSystem.h"
  7.  
  8. class CVehicle;
  9.  
  10. //! Light or sound indicator according to damage ratio.
  11. class CVehicleDamageBehaviorIndicator
  12.         : public IVehicleDamageBehavior
  13. {
  14.         IMPLEMENT_VEHICLEOBJECT
  15. public:
  16.  
  17.         CVehicleDamageBehaviorIndicator();
  18.         virtual ~CVehicleDamageBehaviorIndicator() {}
  19.  
  20.         virtual bool Init(IVehicle* pVehicle, const CVehicleParams& table) override;
  21.         virtual void Reset() override;
  22.         virtual void Release() override { delete this; }
  23.  
  24.         virtual void Serialize(TSerialize ser, EEntityAspects aspects) override;
  25.         virtual void Update(const float deltaTime) override;
  26.  
  27.         virtual void OnDamageEvent(EVehicleDamageBehaviorEvent event, const SVehicleDamageBehaviorEventParams& behaviorParams) override;
  28.         virtual void OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params) override {}
  29.  
  30.         virtual void GetMemoryUsage(ICrySizer* s) const override;
  31.  
  32. protected:
  33.         void GetMaterial();
  34.         void SetActive(bool active);
  35.         void EnableLight(bool enable);
  36.  
  37.         CVehicle* m_pVehicle;
  38.  
  39.         bool      m_isActive;
  40.         float     m_ratioMin;
  41.         float     m_ratioMax;
  42.         float     m_currentDamageRatio;
  43.  
  44.         // Light
  45.         string          m_material;
  46.         IMaterial*      m_pSubMtl;
  47.  
  48.         string          m_sound;
  49.         float           m_soundRatioMin;
  50.         IVehicleHelper* m_pHelper;
  51.  
  52.         int             m_soundsPlayed;
  53.         float           m_lastDamageRatio;
  54.  
  55.         float           m_lightUpdate;
  56.         float           m_lightTimer;
  57.         bool            m_lightOn;
  58.  
  59.         static float    m_frequencyMin;
  60.         static float    m_frequencyMax;
  61. };
  62.  
  63. #endif
  64.  
downloadVehicleDamageBehaviorIndicator.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