VR-Forces 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() override;
68 
70  virtual bool init() override;
71 
73  virtual bool registerRadioMessageCallbacks();
74 
80  virtual bool createPSR();
81 
83  virtual void setComponentDescriptor(DtComponentDescriptor* componentDescriptor) override;
84 
87  virtual const char* type() const override;
88 
91  virtual void tick() override;
92 
94  virtual bool taskVisualizationsActive() const override;
95 
96 protected:
97 
99  virtual bool createPorts() override;
100 
104  virtual bool checkAlive();
105 
107  virtual bool checkTrigger();
108 
110  virtual bool checkArmed();
111 
119  virtual bool checkProximityDetonate(DtVector& detonationLocation);
120 
122  virtual bool checkTargetMiss();
123 
125  virtual void checkMissileDetonation();
126 
142  virtual const DtSimObject* detectCollision(double& distToImpactSqrd,
143  DtVector& detonLocationOut);
144 
151  virtual bool preventCollisionsWithMatchingTypes();
152 
164  virtual bool checkEntityForCollision(const DtSimObject* collidee, const DtVector& missilePath,
165  const DtVector& missileBoxCenter, DtVector& detonLocationOut, double& distToImpactSqrd);
166 
185  virtual bool checkForGroundImpact(double& distToImpactSqrd,
186  DtVector& impactPoint, DtDetonationResult& result, bool& dataAvailable);
187 
192  virtual void sendDetonation(const DtSimObject* impactedEntity,
193  const DtVector& detonLocation);
194 
198  virtual void sendDetonation(DtDetonationResult result,
199  const DtVector& collisionPt);
200 
204  virtual void destroyAndRemoveEntity();
205 
207  bool detonationInAir(const DtVector& localPosition) const;
208 
211  virtual void updateTaskVisualizations() override;
212 
213 public:
215  static void setWarheadInfoCallback(DtSimMessage* msg, void* usr);
216 
218  static void setLocationCallback(DtSimMessage * msg, void * usrData);
219 
222  virtual void processWarheadInfoCallback(DtSimMessage* msg);
223 
226  virtual void processSetLocationCallback();
227 
228 
229 
231 
232  virtual void processLaserDesignatorRemoved(const makVrf::DtFrameStateInterface* designator);
234 
236 
237  static void objectAboutToBeRemovedCallback(const DtLocalObject* object, void* usr);
238  virtual void processObjectAboutToBeRemoved(const DtLocalObject* object);
240 
242  virtual bool movingUp() const;
243 
247  static DtSimComponent * creator(const DtString& name,
248  DtLocalObject* owner,
249  DtSimulationServices* simManager,
250  DtComponentDescriptor* desc = 0,
251  DtReaderWriterRegistry* parentRegistry = 0);
252 
253 private:
257 
260 
263  const DtWarheadDetonationActuator & orig);
264 
265 protected:
266 
272 
278 
280  Dt3dBoundingVolume *myCollisionBV;
281 
287 
292 
294 
298 
301 
305 
309  boost::signals2::scoped_connection myLaserDesignatorRemovedConnection;
310 
315 
324 
327 
328  boost::signals2::connection mySetLocationCompleteConnection;
330 };
#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:309
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:304
virtual bool taskVisualizationsActive() const
Returns true if task visualizations are currently active for this component. Default behavior is to r...
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
DtManagedObjectListConstPtr myPlatformsList
Definition: warheadDetonationActuator.h:325
const makVrf::DtLaserDesignatorStateComponent * myLaserDesignator
Cached pointer to the designator specified in the PSR, prevents a lookup each tick when a detonation ...
Definition: warheadDetonationActuator.h:308
DtBooleanInputPort * myTriggerInputPort
Input Port Name: trigger Input Port Description: Checks to see if the trigger was set...
Definition: warheadDetonationActuator.h:271
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:277
std::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
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:91
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 DtEntityType 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
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:443
DtVector myLastPositionTerrainAvailable
The last entity position, when a terrain intersection for ground impact returned dataAvailable = true...
Definition: warheadDetonationActuator.h:286
DtString myEventId
Definition: warheadDetonationActuator.h:300
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:318
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:61
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 bool init() override
Overridden to cache a pointer to the entity&#39;s radio in this class.
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
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:323
bool myStartPositionInited
Definition: warheadDetonationActuator.h:293
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: warheadDetonationActuator.h:326
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:329
boost::signals2::connection mySetLocationCompleteConnection
Definition: warheadDetonationActuator.h:328
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
DtWarheadDetonationActuatorPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: warheadDetonationActuator.h:297
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
DtWarheadDetonationActuatorDescriptor; descriptor for the DtWarheadDetonationActuator component...
Definition: warheadDetonationActuatorDescriptor.h:26
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:80
DtWarheadDetonationActuatorDescriptor * myWarheadDescriptor
Definition: warheadDetonationActuator.h:299
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:314
Dt3dBoundingVolume * myCollisionBV
Definition: warheadDetonationActuator.h:280
DtVector myLastPositionPreviousTick
The entity position at the previous tick (frame). The myLastPositionPreviousTick will be used when de...
Definition: warheadDetonationActuator.h:291
DtVrfObjectStateRepository * myStateRep
Definition: warheadDetonationActuator.h:279
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:294
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.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)