VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanFleeController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
12 
13 #pragma once
14 
17 #include <vrfNavigation/navArea.h>
18 
21 class DtScriptedTaskTask;
23 class DtHumanFleePSR;
25 class DtVectorOutputPort;
27 
33 {
34 private:
41 public:
43  DtHumanFleeController(const DtString& name, DtVrfObject* owner,
44  DtSimManager* simManager, DtComponentDescriptor* desc=0, DtReaderWriterRegistry *parentRegistry=0);
45 
47  virtual ~DtHumanFleeController();
48 
50  virtual bool init();
51 
53  virtual const char* type() const;
54 
56  virtual void tick();
57 
62  static void fleeCallback(DtSimMessage * msg, void * usr);
63 
65  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner, DtSimManager* simManager,
66  DtComponentDescriptor* desc=0, DtReaderWriterRegistry* parentRegistry=0);
67 
68 protected:
69 
71  virtual bool createPortGroups();
72 
74  virtual bool createPorts();
75 
76  virtual bool usingNavBot() const;
77 
78  virtual void processFleeTask(DtSimMessage * msg);
79 
81  virtual void registerTaskMsgCallbacks();
82 
83  static void navAreaChangedCallback(void* usr);
84  virtual void processNavAreaChanged();
85 
88  virtual std::list<DtVector> getFleeFromPoints(DtScriptedTaskTask*);
89 
91  virtual double getFleeRadius(DtScriptedTaskTask*);
92 
94  virtual bool atDestination();
95 
97  virtual void doMoving();
98 
100  virtual double findDesiredHeading();
101 
104  virtual void stop(bool success);
105 
106  virtual void clearTask();
107 
111  virtual DtVector findFleeToPoint(double radius, const std::list<DtVector>& localFrom);
112 
115  virtual double fleePointMaxCost(const std::list<DtVector>& fleeFromPtList, const DtVector& fleeToPt,
116  double maxFleeDist, bool collision);
117 
120  virtual double fleePointCost(const DtVector& fleeFromPt, const DtVector& fleeToPt,
121  double maxFleeDist, bool collision);
122 
125  virtual bool pointsMoved(const std::list<DtVector>& pts1, const std::list<DtVector>& pts2, double threshhold);
126 
128  static void objectAboutToBeRemoved(DtVrfObject * msg, void * usr);
129  virtual void processObjectAboutToBeRemoved(DtVrfObject * msg);
130 
132  virtual void processFleeTask(DtScriptedTaskTask*);
133 
134  virtual void showFleePoint();
135 
136  virtual void preFirstTickInit();
137  virtual bool createPSR();
138 
139  virtual bool entityInDestination(const DtVector& dest);
140 
141  virtual void updateTaskVisualizations();
142 
143  static void navigationInterfaceChanged(DtVrfObject*, void* usr);
144  virtual void processNavigationInterfaceChanged(DtVrfObject*);
145 
146 protected:
151 
153 
157  std::list<DtVector> myCachedFleeFromPoints;
158 
159  typedef std::pair<DtVector, double> PointAndCost;
160  std::vector<PointAndCost> myCandidateFleeToPoints;
161 
162 
165 
168 
175 
182 
189 
191 
193 };

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)