BVB Source Codes

CRYENGINE Show MoveOp.h Source code

Return Download CRYENGINE: download MoveOp.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #pragma once
  4.  
  5. #ifndef MoveOp_h
  6.         #define MoveOp_h
  7.  
  8.         #include "EnterLeaveUpdateGoalOp.h"
  9.         #include <CryAISystem/MovementRequest.h>
  10.         #include <CryAISystem/MovementStyle.h>
  11.  
  12. struct MovementRequestResult;
  13.  
  14. class MoveOp : public EnterLeaveUpdateGoalOp
  15. {
  16. public:
  17.         MoveOp();
  18.         MoveOp(const XmlNodeRef& node);
  19.  
  20.         virtual void Enter(CPipeUser& pipeUser);
  21.         virtual void Leave(CPipeUser& pipeUser);
  22.         virtual void Update(CPipeUser& pipeUser);
  23.  
  24.         void         SetMovementStyle(MovementStyle movementStyle);
  25.         void         SetStopWithinDistance(float distance);
  26.         void         SetRequestStopWhenLeaving(bool requestStop);
  27.  
  28.         enum DestinationType
  29.         {
  30.                 Target,
  31.                 Cover,
  32.                 ReferencePoint,
  33.                 FollowPath,
  34.                 Formation,
  35.         };
  36.  
  37. private:
  38.         Vec3  DestinationPositionFor(CPipeUser& pipeUser);
  39.         Vec3  GetCoverRegisterLocation(const CPipeUser& pipeUser) const;
  40.         void  RequestMovementTo(const Vec3& position, CPipeUser& pipeUser);
  41.         void  RequestFollowExistingPath(const char* pathName, CPipeUser& pipeUser);
  42.         void  ReleaseCurrentMovementRequest();
  43.         void  MovementRequestCallback(const MovementRequestResult& result);
  44.         void  ChaseTarget(CPipeUser& pipeUser);
  45.         float GetSquaredDistanceToDestination(CPipeUser& pipeUser);
  46.         void  RequestStop(CPipeUser& pipeUser);
  47.         void  GetClosestDesignedPath(CPipeUser& pipeUser, stack_string& closestPathName);
  48.         void  SetupDangersFlagsForDestination(bool shouldAvoidDangers);
  49.         Vec3              m_destinationAtTimeOfMovementRequest;
  50.         float             m_stopWithinDistanceSq;
  51.         MovementStyle     m_movementStyle;
  52.         MovementRequestID m_movementRequestID;
  53.         DestinationType   m_destination;
  54.         stack_string      m_pathName;
  55.         MNMDangersFlags   m_dangersFlags;
  56.         bool              m_requestStopWhenLeaving;
  57.  
  58.         // When following according to the formation, we impose 2 radii around our formation slot:
  59.         // If we're *outside* the outer radius and behind, we catch up until we are inside the *inner* radius. From then on
  60.         // we simply match our speed with that of the formation owner. If we fall behind outside the outer radius,
  61.         // we catch up again. If we're outside the outer radius but *ahead*, then we slow down.
  62.         struct FormationInfo
  63.         {
  64.                 enum State
  65.                 {
  66.                         State_MatchingLeaderSpeed, // we're inside the inner radius
  67.                         State_CatchingUp,          // we're outside the outer radius and behind our formation slot
  68.                         State_SlowingDown,         // we're outside the outer radius and ahead of our formation slot
  69.                 };
  70.  
  71.                 State state;
  72.                 Vec3  positionInFormation;
  73.                 bool  positionInFormationIsReachable;
  74.  
  75.                 FormationInfo()
  76.                         : state(State_MatchingLeaderSpeed)
  77.                         , positionInFormation(ZERO)
  78.                         , positionInFormationIsReachable(true)
  79.                 {}
  80.         };
  81.  
  82.         FormationInfo m_formationInfo;    // only used if m_destination == Formation, ignored for all other destination types
  83. };
  84.  
  85. struct MoveOpDictionaryCollection
  86. {
  87.         MoveOpDictionaryCollection();
  88.  
  89.         CXMLAttrReader<MoveOp::DestinationType> destinationTypes;
  90. };
  91.  
  92. #endif // MoveOp_h
  93.  
downloadMoveOp.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