VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
warheadDetonationActuator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
18 #include <boost/signals2.hpp>
19 
20 class Dt3dBoundingVolume;
23 class DtSimMessage;
24 class DtBooleanInputPort;
25 
26 namespace makVrf
27 {
28  class DtLaserDesignatorStateComponent;
29  class DtFrameStateInterface;
30 }
31 
54 {
55 
56 public:
57 
61  DtLocalObject* owner,
62  DtSimulationServices* simManager,
63  DtComponentDescriptor* desc = 0,
64  DtReaderWriterRegistry* parentRegistry = 0);
65 
67  virtual ~DtWarheadDetonationActuator();
68 
70  virtual bool init();
71 
73  virtual bool registerRadioMessageCallbacks();
74 
80  virtual bool createPSR();
81 
83  virtual void setComponentDescriptor(DtComponentDescriptor *componentDescriptor);
84 
87  virtual const char* type() const;
88 
91  virtual void tick();
92 
93 protected:
94 
96  virtual bool createPorts();
97 
101  virtual bool checkAlive();
102 
104  virtual bool checkTrigger();
105 
107  virtual bool checkArmed();
108 
116  virtual bool checkProximityDetonate(DtVector& detonationLocation);
117 
119  virtual bool checkTargetMiss();
120 
122  virtual void checkMissileDetonation();
123 
139  virtual const DtSimObject* detectCollision(double& distToImpactSqrd,
140  DtVector& detonLocationOut);
141 
148  virtual bool preventCollisionsWithMatchingTypes();
149 
161  virtual bool checkEntityForCollision(const DtSimObject* collidee, const DtVector& missilePath,
162  const DtVector& missileBoxCenter, DtVector& detonLocationOut, double& distToImpactSqrd);
163 
182  virtual bool checkForGroundImpact(double& distToImpactSqrd,
183  DtVector& impactPoint, DtDetonationResult& result, bool& dataAvailable);
184 
189  virtual void sendDetonation(const DtSimObject* impactedEntity,
190  const DtVector& detonLocation);
191 
195  virtual void sendDetonation(DtDetonationResult result,
196  const DtVector& collisionPt);
197 
201  virtual void destroyAndRemoveEntity();
202 
204  bool detonationInAir(const DtVector& localPosition) const;
205 public:
207  static void setWarheadInfoCallback(DtSimMessage* msg, void* usr);
208 
210  static void setLocationCallback(DtSimMessage * msg, void * usrData);
211 
214  virtual void processWarheadInfoCallback(DtSimMessage* msg);
215 
218  virtual void processSetLocationCallback(DtSimMessage* msg);
219 
220 
221 
223 
224  virtual void processLaserDesignatorRemoved(const makVrf::DtFrameStateInterface* designator);
226 
228 
229  static void objectAboutToBeRemovedCallback(const DtLocalObject* object, void* usr);
230  virtual void processObjectAboutToBeRemoved(const DtLocalObject* object);
232 
236  static DtSimComponent * creator(const DtString& name,
237  DtLocalObject* owner,
238  DtSimulationServices* simManager,
239  DtComponentDescriptor* desc = 0,
240  DtReaderWriterRegistry* parentRegistry = 0);
241 
242 private:
246 
249 
252  const DtWarheadDetonationActuator & orig);
253 
254 protected:
255 
261 
267 
269  Dt3dBoundingVolume *myCollisionBV;
272 
276 
279 
283 
287  boost::signals2::scoped_connection myLaserDesignatorRemovedConnection;
288 
293 
302 
305 
307 
309 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
boost::signals2::scoped_connection myLaserDesignatorRemovedConnection
Definition: warheadDetonationActuator.h:287
DtSimObjectReference myTargetObject
This is here for performance – the real target is specified by the name in the PSR. We don&#39;t want to look up that name every tick.
Definition: warheadDetonationActuator.h:282
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
DtManagedObjectListConstPtr myPlatformsList
Definition: warheadDetonationActuator.h:303
virtual bool init()
Overridden to cache a pointer to the entity&#39;s radio in this class.
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
const makVrf::DtLaserDesignatorStateComponent * myLaserDesignator
Cached pointer to the designator specified in the PSR, prevents a lookup each tick when a detonation ...
Definition: warheadDetonationActuator.h:286
DtBooleanInputPort * myTriggerInputPort
Input Port Name: trigger Input Port Description: Checks to see if the trigger was set...
Definition: warheadDetonationActuator.h:260
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtBooleanInputPort * myArmedInputPort
Input Port Name: armed Input Port Description: Check to see if warhead is armed. If port is not conne...
Definition: warheadDetonationActuator.h:266
Definition: readerWriterRegistry.h:39
Description: This repository is an internal repository accessible only by local objects. It holds all information that is common to all the forms of all entity/aggregate/control objects within VR-Forces.
Definition: vrfObjectStateRepository.h:90
End User Description: DtActuator is the base class for all actuator model components. Developer Description: The DtActuator base class caches a pointer to the entity&#39;s radio for convenience. Derived classes may have articulated parts that are configured from the DtActuatorComponentDescriptor&#39;s DtSimArtPartDescriptorList. For each articulated part in the list a DtArticulatedPartStateRepository will be created to store the data for the part such as it&#39;s location, rotation and so forth. These are created in the entity&#39;s DtVrfObjectStateRepository createParts() function. This call creates all the attached parts for all the actuators. These articulated state repositories are managed by the DtAttachmentManager. They are cached by their partType which is the DIS Enumeration describing the part from the disEnums.h file and was specified in the actuator&#39;s DtActuatorComponentDescriptor as descriped above. The partType is used as the category of the DtObjectType used to look up articulated parts in the DtAttachementManager. When an actuator needs access to a particular articulated part it looks it up by the part&#39;s object type.
Definition: actuatorComponent.h:47
DtString myEventId
Definition: warheadDetonationActuator.h:278
bool myAmMissile
Flag to let us know this is a missile or a bomb and hence collision impacts will be treated different...
Definition: warheadDetonationActuator.h:296
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: laserDesignatorStateComponent.h:56
virtual void setComponentDescriptor(DtComponentDescriptor *componentDescriptor)
The component descriptor specified in the order of battle file or parameter file that was used to cre...
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtVector myLastPosition
Definition: warheadDetonationActuator.h:270
bool myHavePrintedTerrainWarning
a little bool here so that you only see the warning about terrain not paged in yet once as opposed to...
Definition: warheadDetonationActuator.h:301
bool myStartPositionInited
Definition: warheadDetonationActuator.h:271
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: warheadDetonationActuator.h:304
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
bool mySetDestroyed
Definition: warheadDetonationActuator.h:306
bool myRecievedSetLocationMessage
Definition: warheadDetonationActuator.h:308
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
DtWarheadDetonationActuatorPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: warheadDetonationActuator.h:275
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
DtWarheadDetonationActuatorDescriptor; descriptor for the DtWarheadDetonationActuator component...
Definition: warheadDetonationActuatorDescriptor.h:25
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
DtWarheadDetonationActuatorDescriptor * myWarheadDescriptor
Definition: warheadDetonationActuator.h:277
DtBoost::shared_ptr< const DtManagedObjectList > DtManagedObjectListConstPtr
Typedef for a shared pointer to a const DtOrgViewManagedObjectList. These lists are used within VR-Fo...
Definition: managedObjectList.h:35
class DtWarheadDetonationActuatorPSR:
Definition: warheadDetonationActuatorPSR.h:27
bool myNeedToDisplayTargetNotFoundWarning
Flag to indicate we need to display a warning message for target not found condition. Only needs to be displayed once. Displaying every time its ticked can generate a slew of warnings in the console.
Definition: warheadDetonationActuator.h:292
Dt3dBoundingVolume * myCollisionBV
Definition: warheadDetonationActuator.h:269
DtVrfObjectStateRepository * myStateRep
Definition: warheadDetonationActuator.h:268
DtWarheadDetonationActuator is an actuator that simulates the detonation for any type of warhead that...
Definition: warheadDetonationActuator.h:53
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)