BVB Source Codes

CRYENGINE Show VehicleDamages.h Source code

Return Download CRYENGINE: download VehicleDamages.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
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 23:02:2006: Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __VEHICLEDAMAGES_H__
  15. #define __VEHICLEDAMAGES_H__
  16.  
  17. class CVehicle;
  18. class CVehicleDamagesGroup;
  19.  
  20. class CVehicleDamages
  21. {
  22. public:
  23.  
  24.         CVehicleDamages() : m_pVehicle(NULL) {}
  25.  
  26.         struct SDamageMultiplier
  27.         {
  28.                 float mult;
  29.                 float splash;
  30.  
  31.                 SDamageMultiplier() : mult(1.f), splash(1.f) {}
  32.  
  33.                 void GetMemoryUsage(ICrySizer* pSizer) const { /*nothing*/ }
  34.         };
  35.  
  36.         enum
  37.         {
  38.                 DEFAULT_HIT_TYPE = 0
  39.         };
  40.  
  41.         void                  InitDamages(CVehicle* pVehicle, const CVehicleParams& table);
  42.         void                  ReleaseDamages();
  43.         void                  ResetDamages();
  44.         void                  UpdateDamages(float frameTime);
  45.  
  46.         void                  GetDamagesMemoryStatistics(ICrySizer* pSizer) const;
  47.  
  48.         bool                  ProcessHit(float& damage, const HitInfo& hitInfo, bool splash);
  49.         CVehicleDamagesGroup* GetDamagesGroup(const char* groupName);
  50.  
  51.         typedef std::map<int, SDamageMultiplier> TDamageMultipliers;
  52.         static void ParseDamageMultipliers(TDamageMultipliers& multipliersByHitType, TDamageMultipliers& multipliersByProjectile, const CVehicleParams& table, const IEntity& entity);
  53.  
  54. protected:
  55.         CVehicle* m_pVehicle;
  56.  
  57.         typedef std::vector<CVehicleDamagesGroup*> TVehicleDamagesGroupVector;
  58.         TVehicleDamagesGroupVector m_damagesGroups;
  59.  
  60.         SVehicleDamageParams       m_damageParams;
  61.  
  62.         TDamageMultipliers         m_damageMultipliersByHitType;
  63.         TDamageMultipliers         m_damageMultipliersByProjectile;
  64. };
  65.  
  66. #endif
  67.  
downloadVehicleDamages.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