BVB Source Codes

CRYENGINE Show WalkabilityCacheManager.h Source code

Return Download CRYENGINE: download WalkabilityCacheManager.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __WalkabilityCacheManager_h__
  4. #define __WalkabilityCacheManager_h__
  5.  
  6. #include <CryMemory/PoolAllocator.h>
  7. #include "WalkabilityCache.h"
  8.  
  9. class WalkabilityCacheManager
  10. {
  11. public:
  12.         WalkabilityCacheManager();
  13.         ~WalkabilityCacheManager();
  14.  
  15.         void Reset();
  16.         void PreUpdate();
  17.         void PostUpdate();
  18.         void Draw();
  19.  
  20.         void EnableActor(tAIObjectID actorID, bool enabled);
  21.         void PrepareActor(tAIObjectID actorID, const AABB& aabb);
  22.  
  23.         bool IsFloorCached(tAIObjectID actorID, const Vec3& position, Vec3& floor);
  24.         bool FindFloor(tAIObjectID actorID, const Vec3& position, Vec3& floor);
  25.         bool CheckWalkability(tAIObjectID actorID, const Vec3& origin, const Vec3& target, float radius, Vec3* finalFloor = 0,
  26.                               bool* flatFloor = 0);
  27.         bool CheckWalkability(tAIObjectID actorID, const Vec3& origin, const Vec3& target, float radius,
  28.                               const ListPositions& boundary, Vec3* finalFloor = 0, bool* flatFloor = 0, const AABB* boundaryAABB = 0);
  29. private:
  30.         struct ActorWalkabilityCache
  31.         {
  32.                 ActorWalkabilityCache()
  33.                         : cache(0)
  34.                         , frameID(0)
  35.                 {
  36.                 }
  37.  
  38.                 WalkabilityCache* cache;
  39.                 size_t            frameID;
  40.         };
  41.  
  42.         size_t m_currentFrameID;
  43.  
  44.         typedef VectorMap<tAIObjectID, ActorWalkabilityCache> ActorWalkabilityCaches;
  45.         ActorWalkabilityCaches                           m_caches;
  46.  
  47.         stl::PoolAllocatorNoMT<sizeof(WalkabilityCache)> m_alloc;
  48.  
  49.         size_t m_walkabilityRequestCount;
  50.         size_t m_walkabilityCacheHitCount;
  51.         size_t m_floorRequestCount;
  52.         size_t m_floorCacheHitCount;
  53.         size_t m_preservedFloorCache;
  54. };
  55.  
  56. #endif
  57.  
downloadWalkabilityCacheManager.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