BVB Source Codes

CRYENGINE Show AIDynHideObjectManager.h Source code

Return Download CRYENGINE: download AIDynHideObjectManager.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /********************************************************************
  4.    -------------------------------------------------------------------------
  5.    File name:   AIDynHideObjectManager.h
  6.    $Id$
  7.    Description: Provides to query hide points around entities which
  8.    are flagged as AI hideable. The manage also caches the objects.
  9.  
  10.    -------------------------------------------------------------------------
  11.    History:
  12.    - 2007                               : Created by Mikko Mononen
  13.    - 2 Mar 2009 : Evgeny Adamenkov: Removed IRenderer
  14.  
  15.  *********************************************************************/
  16.  
  17. #ifndef _AIDYNHIDEOBJECTMANAGER_H_
  18. #define _AIDYNHIDEOBJECTMANAGER_H_
  19.  
  20. #if _MSC_VER > 1000
  21.         #pragma once
  22. #endif
  23.  
  24. #include <CryCore/StlUtils.h>
  25.  
  26. struct SDynamicObjectHideSpot
  27. {
  28.         Vec3         pos, dir;
  29.         EntityId     entityId;
  30.         unsigned int nodeIndex;
  31.  
  32.         SDynamicObjectHideSpot(const Vec3& pos = ZERO, const Vec3& dir = ZERO, EntityId id = 0, unsigned int nodeIndex = 0) :
  33.                 pos(pos), dir(dir), entityId(id), nodeIndex(nodeIndex) {}
  34. };
  35.  
  36. class CAIDynHideObjectManager
  37. {
  38. public:
  39.         CAIDynHideObjectManager();
  40.  
  41.         void Reset();
  42.  
  43.         void GetHidePositionsWithinRange(std::vector<SDynamicObjectHideSpot>& hideSpots, const Vec3& pos, float radius,
  44.                                          IAISystem::tNavCapMask navCapMask, float passRadius, unsigned int lastNavNodeIndex = 0);
  45.  
  46.         bool ValidateHideSpotLocation(const Vec3& pos, const SAIBodyInfo& bi, EntityId objectEntId);
  47.  
  48.         void DebugDraw();
  49.  
  50. private:
  51.  
  52.         void         ResetCache();
  53.         void         FreeCacheItem(int i);
  54.         int          GetNewCacheItem();
  55.         unsigned int GetPositionHashFromEntity(IEntity* pEntity);
  56.         void         InvalidateHideSpotLocation(const Vec3& pos, EntityId objectEntId);
  57.  
  58.         struct SCachedDynamicObject
  59.         {
  60.                 EntityId                            id;
  61.                 unsigned int                        positionHash;
  62.                 std::vector<SDynamicObjectHideSpot> spots;
  63.                 CTimeValue                          timeStamp;
  64.         };
  65.  
  66.         typedef VectorMap<EntityId, unsigned int> DynamicOHideObjectMap;
  67.  
  68.         DynamicOHideObjectMap             m_cachedObjects;
  69.         std::vector<SCachedDynamicObject> m_cache;
  70.         std::vector<int>                  m_cacheFreeList;
  71. };
  72.  
  73. #endif  // #ifndef _AIDYNHIDEOBJECTMANAGER_H_
  74.  
downloadAIDynHideObjectManager.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