VR-Forces 4.1 Class Documentation
indFireCtlr.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 
12 #pragma once
13 
15 #include "vrfutil/simMunition.h"
16 
18 #include <vlpi/disEnums.h>
19 #include <matrix/vlVector.h>
20 
21 class DtString;
22 class DtSimManager;
23 class DtTaskMessage;
24 class DtSimMessage;
25 class DtMunitionResource;
26 
30 
31 
38 {
39 
40 public:
41 
45  DtVrfObject* owner,
46  DtSimManager* simManager,
47  DtComponentDescriptor* desc = 0,
48  DtReaderWriterRegistry* parentRegistry = 0);
49 
51  virtual ~DtIndirectFireController();
52 
54  virtual bool init();
55 
58  virtual bool postAddComponentsInit();
59 
61  virtual bool createWeaponController();
62 
65  virtual DtString type() const;
66 
71  virtual void tick();
72 
75  virtual void clearTask();
76 
78  virtual void setMyFuzeToUse(DtDetonatorFuze fuzeToUse);
80  virtual DtDetonatorFuze fuzeToUse() const;
81 
85  virtual void calculateDesiredElevation(double rangeToTarget);
86 
89  virtual void calculateDesiredAzimuth();
90 
92  double findBodyHeadingToLocalPosition(DtVector localTargetPosition) const;
93 
96  virtual void chooseMaxRange(DtReal rangeToTarget);
97 
99  virtual void setCurrentMaxRange(DtReal currentMaxRange);
101  virtual DtReal currentMaxRange() const;
102 
105  virtual DtReal absoluteMaxRange() const;
106 
110  virtual bool initializeController(const DtString& ammoType,
111  int numberOfRounds, DtReal heightAboveTerrain);
112 
114  virtual void setCurrentTargetLocation(const DtVector& location);
116  virtual const DtVector& currentTargetLocation();
117 
123  virtual void registerTaskMsgCallbacks();
124 
126  static void FFEOnTargetCallback(DtSimMessage * msg, void * usr);
128  static void FFEOnEntityCallback(DtSimMessage * msg, void * usr);
130  static void FFEOnLocationCallback(DtSimMessage * msg, void * usr);
132  static void userTaskCallback(DtSimMessage * msg, void * usr);
133 
140  virtual bool processFFEOnTargetTask(DtSimMessage * msg);
141  virtual bool processFFEOnLocationTask(DtSimMessage * msg);
142  virtual bool processFFEOnEntityTask(DtSimMessage * msg);
148  virtual void processUserTask(DtSimMessage * msg);
151  virtual void processFFETask(DtTaskMessage * tm);
152 
153 
156  virtual bool haveAmmo(const DtString & ammoName) const;
157 
160  virtual const DtString & findDefaultAmmo() const;
161 
164  virtual void getMunitionFromResourceName(const DtString & resourceName,
165  DtSimMunition& munition) const;
166 
169  virtual DtMunitionResource * lookupMunitionResource(const DtString &
170  resource) const;
171 
175  static DtSimComponent * creator(const DtString& name,
176  DtVrfObject* owner,
177  DtSimManager* simManager,
178  DtComponentDescriptor* desc = 0,
179  DtReaderWriterRegistry* parentRegistry = 0);
180 
181 protected:
182 
185  virtual bool createPortGroups();
186 
188  virtual void addRangeItems();
189 
190 protected:
191 
194 
197 
200  orig);
201 
202 protected:
203 
205  DtDetonatorFuze myFuzeToUse;
206 
208 
212 
215 
218 };
219 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)