VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diGuyController.h
Go to the documentation of this file.
1  /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
15 #include "vrfutil/simClock.h"
16 #include <vl/hostStructs.h>
17 #include "vrfobjcore/boolIOPort.h"
18 
20 
21 class DtSimManager;
22 class DtSimMessage;
24 class DtDiGuyAnimation;
29 class DtInputPortGroup;
30 class DtAnalogInputPort;
31 class DtBooleanInputPort;
33 
35 {
43 };
44 
62 {
63 
64 public:
65 
68  DtDiGuyController(const DtString& name,
69  DtVrfObject* owner,
70  DtSimManager* simManager,
71  DtComponentDescriptor* desc = 0,
72  DtReaderWriterRegistry* parentRegistry = 0);
73 
75  virtual ~DtDiGuyController();
76 
79  virtual const char* type() const;
80 
83  virtual bool init();
84 
90  virtual bool createPSR();
91 
95  virtual void preFirstTickInit();
96 
98  virtual void tick();
99 
103  virtual void taskedTick(DtTime & dT);
104 
107  virtual bool intrinsicOverride();
108 
112  virtual bool intrinsicTick(DtLifeformStaticPosture post,
113  double speed,DtWeaponState weapon, DtString & demeanor);
114 
116  virtual bool tickWhileDestroyed() const;
117 
120  virtual void setCurrentAnimation(DtDiGuyAnimation * animation,bool overridePosture = false);
121 
124  virtual void sendSetPosture(DtLifeformState post);
125 
127  static void setCharacteristicsCallback(DtSimMessage * msg, void * usr);
128  virtual void processSetCharacterCharacteristics(DtSimMessage* msg);
129 
131  static void setAppearanceCallback(DtSimMessage * msg, void * usr);
132  virtual void processSetCharacterAppearance(DtSimMessage* msg);
133 
135  static void setHandItemCallback(DtSimMessage * msg, void * usr);
136  virtual void processSetCharacterHandItem(DtSimMessage* msg);
137 
139  static void setHeadCallback(DtSimMessage * msg, void * usr);
140  virtual void processSetCharacterHead(DtSimMessage* msg);
141 
142  static void setRestoreCallback(DtSimMessage * msg, void * usrData);
143  virtual void processSetRestore(DtSimMessage * msg);
144 
145  static void animationTaskCallback(DtSimMessage * msg, void * usrData);
146  virtual void processAnimationTask(DtSimMessage * msg);
147 
150  virtual void clearTask();
151  virtual void taskComplete(bool success = true);
152  virtual void reset();
153 
155  virtual void updateAnimationState(DtLifeformStaticPosture post,
156  double speed,DtWeaponState weapon, const DtString & demeanor);
157 
159  virtual DtDiGuyDirectionType directionStringToEnum(const DtString & direction);
160 
164  static DtSimComponent * creator(const DtString& name,
165  DtVrfObject* owner,
166  DtSimManager* simManager,
167  DtComponentDescriptor* desc = 0,
168  DtReaderWriterRegistry* parentRegistry = 0);
169 
170 protected:
171 
173  virtual void registerRadioMessageCallbacks();
175  virtual void registerTaskMsgCallbacks();
176 
179  virtual void determineInitialHandItem();
180 
181  virtual DtVector groundClamp(double heading, const DtVector& location) const;
182 
183 protected:
186 
188  DtDiGuyController(const DtDiGuyController & orig);
189 
192  orig);
193 
195  virtual bool createPortGroups();
196 
198  virtual bool createPorts();
199 
202  virtual bool createCollisionPort();
203  virtual bool createAimDirectionPort();
204 
205  virtual bool determineDemeanor(DtWeaponState weapon, DtLifeformStaticPosture post, DtString & demeanor);
206 
208  virtual void determineDirection();
209 
210  virtual DtString chooseRandomAppearance();
211 
213  virtual void updatePosition(const DtTime & dT,DtTaitBryan & localOrientation);
214 
215 protected:
216 
217  //const DtDiGuyControllerDescriptor* myDiGuyDescriptor;
224  DtTaitBryan myTaskedOrientation;
225 
230 
242 
246 
254 
262 
267 
270 
272 };

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)