BVB Source Codes

CRYENGINE Show Cover.h Source code

Return Download CRYENGINE: download Cover.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __Cover_h__
  4. #define __Cover_h__
  5.  
  6. #pragma once
  7.  
  8. #include <CryAISystem/ICoverSystem.h>
  9.  
  10. enum ECoverUsageType
  11. {
  12.         eCU_Hide = 0,
  13.         eCU_UnHide,
  14. };
  15.  
  16. const float LowCoverMinHeight           = 0.75f;
  17. const float LowCoverMaxHeight           = 1.1f;
  18. const float HighCoverMaxHeight          = 2.0f;
  19. const float CoverOffsetUp               = 0.085f;
  20. const float CoverExtraClearance         = 0.15f;
  21. const float CoverSamplerLoopExtraOffset = 0.15f;
  22.  
  23. const Vec3 CoverSamplerBiasUp           = Vec3(0.0f, 0.0f, 0.005f);
  24. const Vec3 CoverUp                      = Vec3(0.0f, 0.0f, 1.0f);
  25.  
  26. const uint32 CoverCollisionEntities     = ent_static | ent_terrain | ent_ignore_noncolliding;
  27.  
  28. struct CoverInterval
  29. {
  30.         CoverInterval()
  31.                 : left(0.0f)
  32.                 , right(0.0f)
  33.         {
  34.         }
  35.  
  36.         CoverInterval(float l, float r)
  37.                 : left(l)
  38.                 , right(r)
  39.         {
  40.         }
  41.  
  42.         float       left;
  43.         float       right;
  44.  
  45.         inline bool Empty() const
  46.         {
  47.                 return (right - left) <= 0.0001f;
  48.         }
  49.  
  50.         inline float Width() const
  51.         {
  52.                 return std::max<float>(0.0f, (right - left));
  53.         }
  54.  
  55.         inline bool Intersect(const CoverInterval& other)
  56.         {
  57.                 left = std::max<float>(left, other.left);
  58.                 right = std::min<float>(right, other.right);
  59.  
  60.                 return !Empty();
  61.         }
  62.  
  63.         inline CoverInterval Intersection(const CoverInterval& other) const
  64.         {
  65.                 CoverInterval result = *this;
  66.                 result.Intersect(other);
  67.  
  68.                 return result;
  69.         }
  70. };
  71.  
  72. #endif
  73.  
downloadCover.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