VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtLaserGuidedLauncherController Class Reference

End User Description: This is a missile launcher controller/actuator combination (does not need to be used with a launcher actuator) which monitors the surroundings for a laser designator with a matching laser code to the one in this launcher, and if it is within the launch cone, launches a missile targeted at this designator. More...

Inheritance diagram for DtLaserGuidedLauncherController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtLaserGuidedLauncherController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtLaserGuidedLauncherController ()
 Destructor.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Initialize the component.
virtual void setComponentDescriptor (DtComponentDescriptor *compDesc)
 Overridden to get the specialized DtLaserGuidedLauncherControllerDescriptor.
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.
virtual void tick ()
 Tick Function.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual void addRangeItems ()
 Adds all items that have a range to the object state repository.
virtual bool createPorts ()
 Called by init.
virtual bool missileResourceAvailable () const
 Returns true if there is at least one missile resource remaining of the type specified in the parameter entry.
virtual void consumeMissileResource ()
 Decrements the missile resource by one.
virtual bool fireMunition (DtReflectedDesignator *target)
 Does all actions for creating and firing the munition.
virtual DtVrfObjectcreateMissileObject ()
 Creates a new vrf object for the missile using the type and offset parameters specified in the descriptor.
virtual void createAndSendFireInteraction (DtVrfObject *missile, DtReflectedDesignator *targetDesignator, const DtEventId &eventId)
 Creates the fire interaction for launching of the specified missile.
virtual DtReflectedDesignator * chooseTarget (bool &targetInFireCone, DtVector &targetLocalPosition)
 Chooses an appropriate designator object as the target to engage.
virtual bool targetDesginatorValid (DtReflectedDesignator *target, DtVector &targetLocalPosition)
virtual bool targetDesginatorInFireCone (DtReflectedDesignator *target)
virtual bool munitionLoaded () const
virtual DtVector launcherGeocentricPosition () const
virtual bool missileInFlight ()
virtual int defaultLaserCode () const

Protected Attributes

const
DtLaserGuidedLauncherControllerDescriptor
myDescriptor
 Pointer to my descriptor.
DtLaserLauncherPSRmyProcessState
 Container for state data associated with this component.
bool myFirstTick
Ports and Port Groups
DtVectorOutputPortmyTargetLocationOutputPort
 Output Port Name: target-location
Output Port Description: Provides the local database location of the best available laser spot target that is found by this launcher.

Private Member Functions

 DtLaserGuidedLauncherController ()
 Not implemented.
 DtLaserGuidedLauncherController (const DtLaserGuidedLauncherController &orig)
 Not implemented.
DtLaserGuidedLauncherControlleroperator= (const DtLaserGuidedLauncherController &orig)
 Not implemented.
virtual void processSetLaserCodeRequestMessage (DtSimMessage *msg)
 Processes set laser code requests.
static void setLaserCodeRequestCallback (DtSimMessage *msg, void *usrData)
 Processes set laser code requests.
virtual void processSetSyncLaserCode (DtSimMessage *msg)
 Processes the sync laser code requests by sending a message requesting the laser code from the target entity.
static void setSyncLaserCodeCallback (DtSimMessage *msg, void *usr)
 Processes the sync laser code requests by sending a message requesting the laser code from the target entity.

Detailed Description

End User Description: This is a missile launcher controller/actuator combination (does not need to be used with a launcher actuator) which monitors the surroundings for a laser designator with a matching laser code to the one in this launcher, and if it is within the launch cone, launches a missile targeted at this designator.

This controller processes DtSetLaserCodeRequest and DtSetSyncLaserCode messages to set the laser code. Uses Descriptor Type: DtLaserGuidedLauncherControllerDescriptor


Constructor & Destructor Documentation

Not implemented.

Not implemented.

DtLaserGuidedLauncherController::DtLaserGuidedLauncherController ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor compDesc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Destructor.


Member Function Documentation

DtLaserGuidedLauncherController& DtLaserGuidedLauncherController::operator= ( const DtLaserGuidedLauncherController orig) [private]

Not implemented.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

virtual DtString DtLaserGuidedLauncherController::type ( ) const [virtual]

Returns a string identifies the class type of component.

Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.

Returns:
DtLaserGuidedLauncherControllerType

Reimplemented from DtControllerComponent.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

Initialize the component.

Calls createPSR() and registerRadioMessageCallbacks()

Reimplemented from DtControllerComponent.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

Overridden to get the specialized DtLaserGuidedLauncherControllerDescriptor.

Reimplemented from DtSimComponent.

Creates myProcessState data member, and adds it to our process state repository manager.

Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.

virtual void DtLaserGuidedLauncherController::tick ( ) [virtual]

Tick Function.

Reimplemented from DtSimComponent.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

static DtSimComponent* DtLaserGuidedLauncherController::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
) [static]

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns:
New instance of this class.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

virtual void DtLaserGuidedLauncherController::addRangeItems ( ) [protected, virtual]

Adds all items that have a range to the object state repository.

virtual bool DtLaserGuidedLauncherController::createPorts ( ) [protected, virtual]

Called by init.

Derived classes should override this method to create all their input/output ports and port groups.

Reimplemented from DtSimComponent.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

virtual bool DtLaserGuidedLauncherController::missileResourceAvailable ( ) const [protected, virtual]

Returns true if there is at least one missile resource remaining of the type specified in the parameter entry.

virtual void DtLaserGuidedLauncherController::consumeMissileResource ( ) [protected, virtual]

Decrements the missile resource by one.

virtual bool DtLaserGuidedLauncherController::fireMunition ( DtReflectedDesignator *  target) [protected, virtual]

Does all actions for creating and firing the munition.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

Creates a new vrf object for the missile using the type and offset parameters specified in the descriptor.

Returns a pointer to the newly created object.

virtual void DtLaserGuidedLauncherController::createAndSendFireInteraction ( DtVrfObject missile,
DtReflectedDesignator *  targetDesignator,
const DtEventId &  eventId 
) [protected, virtual]

Creates the fire interaction for launching of the specified missile.

Target information is taken from currentTaskMessage().

virtual DtReflectedDesignator* DtLaserGuidedLauncherController::chooseTarget ( bool targetInFireCone,
DtVector targetLocalPosition 
) [protected, virtual]

Chooses an appropriate designator object as the target to engage.

Uses targetDesignatorValid() to check if each potential target is valid.

Returns:
The target. Returns NULL if no target.
Parameters:
targetInFireConeThis bool is returned by the function, indicating whether the returned target is within the firing cone defined by the descriptor.
targetLocalPositionThis will contain the local database position of the target if a target is returned by this function.
virtual bool DtLaserGuidedLauncherController::targetDesginatorValid ( DtReflectedDesignator *  target,
DtVector targetLocalPosition 
) [protected, virtual]
Returns:
True if the provided target is valid. Checks for a clear LOS to the target, as well as if the laser code of the designator matches the code set for this launcher. Does not check if the target is in the fire cone or not.
Parameters:
targetLocalPositionFills in the database location of the target to this parameter.
virtual bool DtLaserGuidedLauncherController::targetDesginatorInFireCone ( DtReflectedDesignator *  target) [protected, virtual]
Returns:
True if the designator is within the defined fire cone.
virtual bool DtLaserGuidedLauncherController::munitionLoaded ( ) const [protected, virtual]
Returns:
True when enough time has passed since the last munition fired to fire another.
Returns:
The geocentric position of the launcher, using the entity's current position, and the launcher offset from the descriptor.
virtual bool DtLaserGuidedLauncherController::missileInFlight ( ) [protected, virtual]
Returns:
True if the last missile fired by this launcher still exists.
virtual int DtLaserGuidedLauncherController::defaultLaserCode ( ) const [protected, virtual]
Returns:
The default laser code. Calls generateLaserCodeFromName().
static void DtLaserGuidedLauncherController::setLaserCodeRequestCallback ( DtSimMessage msg,
void *  usrData 
) [static, protected]

Processes set laser code requests.

Processes set laser code requests.

static void DtLaserGuidedLauncherController::setSyncLaserCodeCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]

Processes the sync laser code requests by sending a message requesting the laser code from the target entity.

virtual void DtLaserGuidedLauncherController::processSetSyncLaserCode ( DtSimMessage msg) [protected, virtual]

Processes the sync laser code requests by sending a message requesting the laser code from the target entity.


Member Data Documentation

Pointer to my descriptor.

Reimplemented in DtIntegratedLaserGuidedLauncherController.

Container for state data associated with this component.

This state is saved and restored as part of a scenario (or checkpoint).

Output Port Name: target-location
Output Port Description: Provides the local database location of the best available laser spot target that is found by this launcher.

Provided so that it can be hooked to movement system of entities that need to reorient to fire on the target.
Output Port Range: Local database locations.


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)