BVB Source Codes

CRYENGINE Show VehicleDamagesGroup.h Source code

Return Download CRYENGINE: download VehicleDamagesGroup.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 the base of the vehicle damages group
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 23:02:2006: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEDAMAGESGROUP_H__
  15. #define __VEHICLEDAMAGESGROUP_H__
  16.  
  17. class CVehicle;
  18.  
  19. class CVehicleDamagesGroup
  20.         : public IVehicleDamagesGroup
  21. {
  22. public:
  23.  
  24.         virtual ~CVehicleDamagesGroup();
  25.  
  26.         bool          Init(CVehicle* pVehicle, const CVehicleParams& table);
  27.         void          Release() { delete this; }
  28.         void          Reset();
  29.         void          Serialize(TSerialize ser, EEntityAspects aspects);
  30.  
  31.         virtual bool  ParseDamagesGroup(const CVehicleParams& table);
  32.  
  33.         const string& GetName() { return m_name; }
  34.         bool          IsPotentiallyFatal();
  35.  
  36.         void          OnDamageEvent(EVehicleDamageBehaviorEvent event, const SVehicleDamageBehaviorEventParams& behaviorParams);
  37.         void          Update(float frameTime);
  38.  
  39.         void          GetMemoryUsage(ICrySizer* pSizer) const;
  40.  
  41. protected:
  42.  
  43.         typedef std::vector<IVehicleDamageBehavior*> TVehicleDamageBehaviorVector;
  44.  
  45.         typedef uint16                               TDamagesSubGroupId;
  46.         struct SDamagesSubGroup
  47.         {
  48.                 TDamagesSubGroupId           id;
  49.                 float                        m_randomness;
  50.                 TVehicleDamageBehaviorVector m_damageBehaviors;
  51.                 float                        m_delay;
  52.                 bool                         m_isAlreadyInProcess;
  53.  
  54.                 SDamagesSubGroup()
  55.                 {
  56.                         id = ~0;
  57.                         m_randomness = 0.f;
  58.                         m_delay = 0.f;
  59.                         m_isAlreadyInProcess = false;
  60.                 }
  61.                 void GetMemoryUsage(ICrySizer* pSizer) const {}
  62.         };
  63.  
  64.         typedef std::vector<SDamagesSubGroup> TDamagesSubGroupVector;
  65.         TDamagesSubGroupVector m_damageSubGroups;
  66.  
  67. protected:
  68.  
  69.         IVehicleDamageBehavior* ParseDamageBehavior(const CVehicleParams& table);
  70.  
  71.         CVehicle* m_pVehicle;
  72.         string    m_name;
  73.  
  74.         struct SDelayedDamagesSubGroupInfo
  75.         {
  76.                 float                             delay;
  77.                 TDamagesSubGroupId                subGroupId;
  78.                 SVehicleDamageBehaviorEventParams behaviorParams;
  79.         };
  80.  
  81.         typedef std::list<SDelayedDamagesSubGroupInfo> TDelayedDamagesSubGroupList;
  82.         TDelayedDamagesSubGroupList m_delayedSubGroups;
  83.  
  84.         friend class CVehicleDamagesTemplateRegistry;
  85. };
  86.  
  87. #endif
  88.  
downloadVehicleDamagesGroup.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