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

DtLauncherActuator is a simple model of a missile launcher. More...

Inheritance diagram for DtLauncherActuator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtLauncherActuator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtLauncherActuator ()
 destructor
virtual bool init ()
 to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void fireTheWeapon ()
 Overrides DtWeaponActuator::fireTheWeapon().
virtual DtFireInteraction * createFireInteraction (DtVrfObject *missile)
 Creates and fills out a DtFireInteraction, given a missile object.

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 bool createPorts ()
 Creates the input ports listed in the header comment and adds them to myWeaponInputPortGroup from DtWeaponActuator.
 DtLauncherActuator ()
 default constructor; not implemented
 DtLauncherActuator (const DtLauncherActuator &orig)
 copy constructor; not implemented
const DtLauncherActuatoroperator= (const DtLauncherActuator &orig)
 assignment operator; not implemented

Protected Attributes

DtVector myCurrentTargetPoint
Ports and Port Groups
DtObjectIdInputPortmyMissileIdPort
 Input Port Name: missile-id
Input Port Description: Object id of the missile.
DtObjectIdInputPortmyTargetEntityIdPort
 Input Port Name: target-entity
Input Port Description: Object id of the target.
DtVectorInputPortmyTargetPointPort
 Input Port Name: target-point
Input Port Description: Local position of the target.

Static Protected Attributes

static bool myDetonationCbackRegistered
 Flag for indicating whether the detonation callback for munitions has been registered.

Detailed Description

DtLauncherActuator is a simple model of a missile launcher.

End User Description: It can be given ammo to load, and the command to fire. It creates a fire interaction and creates a missile object, and sends it on its way.
It can be configured on an entity on its own, forming a fixed launcher, or it can be used in conjunction with the DtAzimuthMountActuator, the DtElevationMountActuator, or both, to form a missile launcher system that can be aimed.
The DtLauncherActuator class is derived from DtWeaponActuator and adds missile ID and target point ports to the ammunition, trigger, and loaded (a boolean flag indicating the weapon is loaded) inputs provided by the DtWeaponActuator.

Uses Descriptor Type: DtWeaponActuatorDescriptor


Constructor & Destructor Documentation

DtLauncherActuator::DtLauncherActuator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 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

default constructor; not implemented

copy constructor; not implemented


Member Function Documentation

virtual bool DtLauncherActuator::init ( ) [virtual]

to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports.

Reimplemented from DtWeaponActuator.

virtual DtString DtLauncherActuator::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:
DtLauncherActuatorType

Reimplemented from DtWeaponActuator.

virtual void DtLauncherActuator::fireTheWeapon ( ) [virtual]

Overrides DtWeaponActuator::fireTheWeapon().

It takes the missile ID found on myMissileIdPort and uses it to look up the corresponding missile object in the DtVrfObjectManager. If a missile object is found, it initializes the missile's start location, orientation, and velocity. If the target-entity port has a target it is passed to the missile's state repository, otherwise it passes the location on the target-point port. It then calls createFireInteraction() with the missile object as an argument.

Reimplemented from DtWeaponActuator.

virtual DtFireInteraction* DtLauncherActuator::createFireInteraction ( DtVrfObject missile) [virtual]

Creates and fills out a DtFireInteraction, given a missile object.

static DtSimComponent* DtLauncherActuator::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 from DtWeaponActuator.

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

Creates the input ports listed in the header comment and adds them to myWeaponInputPortGroup from DtWeaponActuator.

Reimplemented from DtWeaponActuator.

const DtLauncherActuator& DtLauncherActuator::operator= ( const DtLauncherActuator orig) [protected]

assignment operator; not implemented


Member Data Documentation

Input Port Name: missile-id
Input Port Description: Object id of the missile.


Input Port Range:
Input Port Default Value:
Input Group Parent: weapon-control

Input Port Name: target-entity
Input Port Description: Object id of the target.


Input Port Range:
Input Port Default Value:
Input Group Parent: weapon-control

Input Port Name: target-point
Input Port Description: Local position of the target.


Input Port Range:
Input Port Default Value:
Input Group Parent: weapon-control

Flag for indicating whether the detonation callback for munitions has been registered.


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)