BVB Source Codes

CRYENGINE Show MovementSystem.h Source code

Return Download CRYENGINE: download MovementSystem.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 MovementSystem_h
  6.         #define MovementSystem_h
  7.  
  8.         #include <CryAISystem/IMovementSystem.h>
  9.         #include <CryAISystem/MovementRequest.h>
  10.         #include "MovementActor.h"
  11.  
  12. struct MovementUpdateContext;
  13.  
  14. class MovementSystem : public IMovementSystem
  15. {
  16. public:
  17.         MovementSystem();
  18.  
  19.         // IMovementSystem
  20.         virtual void              RegisterEntity(const EntityId entityId, MovementActorCallbacks callbacksConfiguration, IMovementActorAdapter& adapter) override;
  21.         virtual void              UnregisterEntity(const EntityId entityId) override;
  22.         virtual MovementRequestID QueueRequest(const MovementRequest& request) override;
  23.         virtual void              CancelRequest(const MovementRequestID& id) override;
  24.         virtual void              GetRequestStatus(const MovementRequestID& id, MovementRequestStatus& status) const override;
  25.         virtual void              Update(float updateTime) override;
  26.         virtual void              Reset() override;
  27.         virtual void              RegisterFunctionToConstructMovementBlockForCustomNavigationType(Movement::CustomNavigationBlockCreatorFunction blockFactoryFunction) override;
  28.         // ~IMovementSystem
  29.  
  30.         Movement::BlockPtr CreateCustomBlock(const CNavPath& path, const PathPointDescriptor::OffMeshLinkData& mnmData, const MovementStyle& style);
  31.  
  32.         typedef std::pair<MovementRequestID, MovementRequest> MovementRequestPair;
  33.  
  34. private:
  35.         enum ActorUpdateStatus
  36.         {
  37.                 KeepUpdatingActor,
  38.                 ActorCanBeRemoved
  39.         };
  40.  
  41.         MovementRequestID GenerateUniqueMovementRequestID();
  42.         void              FinishRequest(MovementActor& actor, const MovementRequestID requestId, MovementRequestResult::Result result,
  43.                                         MovementRequestResult::FailureReason failureReason = MovementRequestResult::NoReason);
  44.         void              CleanUpAfterFinishedRequest(MovementActor& actor, MovementRequestID activeRequestID);
  45.         MovementRequest&  GetActiveRequest(MovementActor& actor, MovementRequestID* outRequestID = NULL);
  46.         MovementActor&    GetExistingActorOrCreateNewOne(const EntityId entityId, IMovementActorAdapter& adapter);
  47.         MovementActor*    GetExistingActor(const EntityId entityId);
  48.         bool              IsPlannerWorkingOnRequestID(const MovementActor& actor, const MovementRequestID& id) const;
  49.         void              UpdateActors(float updateTime);
  50.         ActorUpdateStatus UpdateActor(MovementActor& actor, float updateTime);
  51.         void              UpdatePlannerAndDealWithResult(const MovementUpdateContext& context);
  52.         void              StartWorkingOnNewRequestIfPossible(const MovementUpdateContext& context);
  53.  
  54.         #if defined(COMPILE_WITH_MOVEMENT_SYSTEM_DEBUG)
  55.         void DrawDebugInformation() const;
  56.         void DrawMovementRequestsForActor(const MovementActor& actor) const;
  57.         #endif
  58.  
  59.         // Contains pairs of MovementRequestID and MovementRequest
  60.         typedef std::vector<MovementRequestPair> Requests;
  61.         Requests m_requests;
  62.  
  63.         // The actors are added and removed when they get new requests and
  64.         // when they run out of them.
  65.         typedef std::vector<MovementActor> Actors;
  66.         Actors                                         m_actors;
  67.  
  68.         MovementRequestID                              m_nextUniqueRequestID;
  69.         Movement::CustomNavigationBlockCreatorFunction m_createMovementBlockToHandleCustomNavigationType;
  70. };
  71.  
  72. #endif // MovementSystem_h
  73.  
downloadMovementSystem.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