BVB Source Codes

CRYENGINE Show AIVehicle.h Source code

Return Download CRYENGINE: download AIVehicle.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef _AI_VEHICLE_
  4. #define _AI_VEHICLE_
  5.  
  6. #if _MSC_VER > 1000
  7.         #pragma once
  8. #endif
  9.  
  10. #include "Puppet.h"
  11.  
  12. class CAIVehicle
  13.         : public CPuppet
  14. {
  15. public:
  16.         CAIVehicle();
  17.         ~CAIVehicle(void);
  18.  
  19.         virtual void     Update(EObjectUpdate type) override;
  20.         virtual void     UpdateDisabled(EObjectUpdate type) override;
  21.         void             Navigate(CAIObject* pTarget);
  22.         virtual void     Event(unsigned short eType, SAIEVENT* pEvent) override;
  23.  
  24.         virtual void     Reset(EObjectResetType type) override;
  25.         virtual void     ParseParameters(const AIObjectParams& params, bool bParseMovementParams = true) override;
  26.         virtual EntityId GetPerceivedEntityID() const override;
  27.  
  28.         void             AlertPuppets(void);
  29.         virtual void     Serialize(TSerialize ser) override;
  30.  
  31.         bool             HandleVerticalMovement(const Vec3& targetPos);
  32.  
  33.         bool             IsDriverInside() const;
  34.         bool             IsPlayerInside();
  35.  
  36.         EntityId         GetDriverEntity() const;
  37.         CAIActor*        GetDriver() const;
  38.  
  39.         virtual bool     IsTargetable() const override { return IsActive(); }
  40.         virtual bool     IsActive() const override     { return m_bEnabled || IsDriverInside(); }
  41.  
  42.         virtual void     GetPathFollowerParams(struct PathFollowerParams& outParams) const override;
  43.  
  44. protected:
  45.         void FireCommand(void);
  46.         bool GetEnemyTarget(int objectType, Vec3& hitPosition, float fDamageRadius2, CAIObject** pTarget);
  47.         void OnDriverChanged(bool bEntered);
  48.  
  49. private:
  50.  
  51.         // local functions for firecommand()
  52.         Vec3  PredictMovingTarget(const CAIObject* pTarget, const Vec3& vTargetPos, const Vec3& vFirePos, const float duration, const float distpred);
  53.         bool  CheckExplosion(const Vec3& vTargetPos, const Vec3& vFirePos, const Vec3& vActuallFireDir, const float fDamageRadius);
  54.         Vec3  GetError(const Vec3& vTargetPos, const Vec3& vFirePos, const float fAccuracy);
  55.         float RecalculateAccuracy(void);
  56.  
  57.         bool        m_bPoweredUp;
  58.  
  59.         CTimeValue  m_fNextFiringTime;      //To put an interval for the next firing.
  60.         CTimeValue  m_fFiringPauseTime;     //Put a pause time after the trurret rotation has completed.
  61.         CTimeValue  m_fFiringStartTime;     //the time that the firecommand started.
  62.  
  63.         Vec3        m_vDeltaTarget;   //To add a vector to the target position for errors and moving prediction
  64.  
  65.         int         m_ShootPhase;
  66.         mutable int m_driverInsideCheck;
  67.         int         m_playerInsideCheck;
  68.         bool        m_bDriverInside;
  69. };
  70.  
  71. ILINE const CAIVehicle* CastToCAIVehicleSafe(const IAIObject* pAI) { return pAI ? pAI->CastToCAIVehicle() : 0; }
  72. ILINE CAIVehicle*       CastToCAIVehicleSafe(IAIObject* pAI)       { return pAI ? pAI->CastToCAIVehicle() : 0; }
  73.  
  74. #endif
  75.  
downloadAIVehicle.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