BVB Source Codes

CRYENGINE Show CoverUser.h Source code

Return Download CRYENGINE: download CoverUser.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __CoverUser_h__
  4. #define __CoverUser_h__
  5.  
  6. #pragma once
  7.  
  8. #include "Cover.h"
  9. #include "CoverPath.h"
  10.  
  11. class CoverUser
  12. {
  13. public:
  14.         CoverUser();
  15.  
  16.         struct Params
  17.         {
  18.                 Params()
  19.                         : distanceToCover(0.4f)
  20.                         , inCoverRadius(0.3f)
  21.                         , userID(0)
  22.                 {
  23.                 }
  24.  
  25.                 float       distanceToCover;
  26.                 float       inCoverRadius;
  27.                 tAIObjectID userID;
  28.         };
  29.  
  30.         void           Reset();
  31.         void           ResetState();
  32.  
  33.         void           SetCoverID(const CoverID& coverID);
  34.         const CoverID& GetCoverID() const;
  35.  
  36.         void           SetParams(const Params& params);
  37.         const Params& GetParams() const;
  38.  
  39.         void          Update(float updateTime, const Vec3& pos, const Vec3* eyes, uint32 eyeCount, float minEffectiveCoverHeight = 0.001f);
  40.         void          UpdateWhileMoving(float updateTime, const Vec3& pos, const Vec3* eyes, uint32 eyeCount);
  41.         void          UpdateNormal(const Vec3& pos);
  42.  
  43.         bool          IsCompromised() const;
  44.         bool          IsFarFromCoverLocation() const;
  45.         float         CalculateEffectiveHeightAt(const Vec3& pos, const Vec3* eyes, uint32 eyeCount) const;
  46.         float         GetLocationEffectiveHeight() const;
  47.         const Vec3& GetCoverNormal() const; // normal pointing out of the cover surface
  48.         Vec3        GetCoverLocation() const;
  49.  
  50.         void        DebugDraw() const;
  51.  
  52. private:
  53.         bool IsInCover(const Vec3& pos, float radius, const Vec3* eyes, uint32 eyeCount) const;
  54.  
  55.         CoverID m_coverID;
  56.         CoverID m_nextCoverID;
  57.  
  58.         float   m_locationEffectiveHeight;
  59.         Vec3    m_location;
  60.         Vec3    m_normal;
  61.  
  62.         bool    m_compromised;
  63.         bool    m_farFromCoverLocation;
  64.  
  65.         Params  m_params;
  66. };
  67.  
  68. #endif
  69.  
downloadCoverUser.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