VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtIndirectFireWeaponController Class Reference

DtIndirectFireWeaponController is a controller that models firing an indirect fire weapon (e.g. a cannon).

Developer Description: Extends the DtBaseWeaponController with the additional ports needed to specify target location and maximum range.

Uses Descriptor Type: DtBaseWeaponControllerDescriptor

Inheritance diagram for DtIndirectFireWeaponController:
Inheritance graph
[legend]

Public Member Functions

 DtIndirectFireWeaponController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtIndirectFireWeaponController ()
 
virtual const chartype () const
 
virtual bool init ()
 
virtual bool createMountingController ()
 
virtual void preFirstTickInit ()
 
virtual void tick ()
 
virtual bool createTargetPointPort ()
 
virtual DtVectorOutputPorttargetPointPort () const
 
virtual bool createMuzzleSpeedPort ()
 
virtual DtAnalogOutputPortmuzzleSpeedPort () const
 
virtual bool createAngleOfFirePort ()
 
virtual DtAnalogOutputPortangleOfFirePort () const
 
virtual bool createAlignedDirectlyPort ()
 
virtual DtBooleanOutputPortalignedDirectlyPort () const
 
virtual bool createMuzzleOffsetPort ()
 
virtual DtVectorInputPortmuzzleOffsetPort () const
 
virtual DtVrfIndirectFirePSRindirectFireProcessState ()
 
virtual const
DtVrfIndirectFirePSR
indirectFireProcessState () const
 
virtual bool haveAmmo (const DtString &ammoName) const
 
virtual const DtStringfindDefaultAmmo () const
 
virtual void getMunitionFromResourceName (const DtString &resourceName, DtSimMunition &munition) const
 
virtual DtMunitionResourcelookupMunitionResource (const DtString &resource) const
 
virtual void setMyFuzeToUse (DtDetonatorFuze fuzeToUse)
 
virtual DtDetonatorFuze fuzeToUse () const
 
virtual void setCurrentMuzzleSpeed (DtReal speed)
 
virtual DtReal currentMuzzleSpeed () const
 
virtual void addRangeItems ()
 
virtual bool initializeController (const DtString &ammoType, DtReal heightAboveTerrain, const DtUUID &targetName, bool &waitingForTerrain, DtDetonatorFuze fuseType, bool generateKnownTargetPoint=false, const DtString &knownTargetPointName="")
 
- Public Member Functions inherited from DtBaseWeaponController
 DtBaseWeaponController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtBaseWeaponController ()
 
virtual bool postAddComponentsInit ()
 
virtual void fire ()
 
virtual bool waitingForFire ()
 
virtual void setWaitingForFire (bool waiting)
 
virtual bool createWeaponOutputPortGroup ()
 
virtual DtOutputPortGroupweaponOutputPortGroup ()
 
virtual bool createWeaponInputPortGroup ()
 
virtual DtInputPortGroupweaponInputPortGroup ()
 
virtual bool createTriggerPort ()
 
virtual DtBooleanOutputPorttriggerPort () const
 
virtual bool createLoadAmmunitionPort ()
 
virtual DtAmmunitionOutputPortloadAmmunitionPort () const
 
virtual bool createLoadedPort ()
 
virtual DtBooleanOutputPortloadedPort () const
 
virtual bool createArtPartTypePort ()
 
virtual DtIntegerInputPortartPartTypePort () const
 
virtual void setPreloadWeapon (bool doPreload)
 
virtual bool preloadWeapon () const
 
virtual void setLoadAmmoTime (DtTime loadAmmoTime)
 
virtual DtTime loadAmmoTime () const
 
virtual void setUnloadAmmoTime (DtTime unloadAmmoTime)
 
virtual DtTime unloadAmmoTime () const
 
virtual void setMaxVehicleSpeedToFire (DtReal maxVehicleSpeedToFire)
 
virtual DtReal maxVehicleSpeedToFire () const
 
virtual bool weaponCorrectlyOriented () const
 
virtual void initProcessSR ()
 
virtual DtBaseMountingControllermountingController ()
 
virtual void setCurrentMunitionName (const DtString &currentMunitionName)
 
virtual const DtStringcurrentMunitionName () const
 
virtual DtVrfWeaponPSRweaponProcessState ()
 
virtual const DtVrfWeaponPSRweaponProcessState () const
 
virtual void setMaxAzimuthAngleOffBoresight (DtReal maxAngle)
 
virtual DtReal maxAzimuthAngleOffBoresight () const
 
virtual void setMaxElevationAngleOffBoresight (DtReal maxAngle)
 
virtual DtReal maxElevationAngleOffBoresight () const
 
- Public Member Functions inherited from DtControllerComponent
 DtControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtControllerComponent ()
 
virtual DtSimRadioradio ()
 
virtual void taskNotify (const DtSimTask &task)
 
virtual void clearTask ()
 
virtual void enableTaskTypes ()
 
virtual void disableTaskTypes ()
 
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSimComponent ()
 
virtual void setParentSystem (DtComponentSystem *system)
 
DtComponentSystemparentSystem () const
 
virtual void postTick ()
 
virtual void timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod)
 
virtual double minTickPeriod () const
 
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 
virtual double minTickPeriodVariance () const
 
virtual void setNextTickTime (double nextTickTime)
 
virtual double nextTickTime () const
 
virtual double calculateNextTickTime () const
 
virtual double calculateFirstTickTime () const
 
virtual void setEntity (DtLocalObject *entity)
 
virtual DtSimComponentnextComponent ()
 
virtual DtSimComponentprevComponent ()
 
virtual void setListItem (DtListItem *item)
 
virtual DtListItem * listItem ()
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void addInputPort (DtInputPort *port)
 
virtual void removeInputPort (DtInputPort *port)
 
virtual DtInputPortlookupInputPort (const DtString &portName)
 
virtual DtList inputPortList () const
 
virtual void addOutputPort (DtOutputPort *port)
 
virtual void removeOutputPort (DtOutputPort *port)
 
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 
virtual DtList outputPortList () const
 
virtual void addInputPortGroup (DtInputPortGroup *group)
 
virtual void removeInputPortGroup (DtInputPortGroup *group)
 
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 
virtual DtList inputPortGroupList () const
 
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
 
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 
virtual DtList outputPortGroupList () const
 
virtual int priority () const
 
virtual void setPriority (int priority)
 
double dT () const
 
virtual void setDT (double deltaT)
 
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 
virtual const
DtComponentDescriptor
componentDescriptor () const
 
virtual bool tickWhileDestroyed () const
 
DtVrfProcessStateRepositoryManagerpsrManager ()
 
virtual const DtSymbolStringcomponentFullName () const
 
DtPhysicalWorldphysicalWorld ()
 
const DtPhysicalWorldphysicalWorld () const
 
const DtAttachedTerrainterrainAttachedTo () const
 
DtLocalObjectentity ()
 
const DtLocalObjectentity () const
 
DtSimulationServicessimulationServices ()
 
const DtSimulationServicessimulationServices () const
 
const Coordinate_SystemcoordinateSystem () const
 
virtual bool taskVisualizationsActive () const
 
virtual bool taskVisualizationsEnabled () const
 
makVrf::DtTaskVisualizationMaptaskVisualizations ()
 
virtual bool isEnabled ()
 
virtual void setIsEnabled (bool yesNo)
 
virtual DtOutputStream & objectConsoleDebug (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleVerbose (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleInfo (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleWarn (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleError (const DtString &channel="") const
 
virtual int notifyLevel () const
 
virtual DtSimResourceManagerresourceManager ()
 
virtual const
DtSimResourceManager
resourceManager () const
 
VRF4API_METHOD const
DtSimulationServices
simManager () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs)
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual void reset ()
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charreaderWriterType () const
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool wasUpdatedSince (DtTime t) const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
- Static Public Member Functions inherited from DtBaseWeaponController
static DtSimComponentcreator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
- Static Public Member Functions inherited from DtSimComponent
static DtSimComponentFactoryfactory ()
 
static void setFactory (DtSimComponentFactory *factory)
 
static DtSimComponentcreateComponent (const DtString &name, const DtString &type, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentSystem *parentSystem, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
static void addSimComponentCreatorFcn (const DtString &type, DtSimComponentCreatorFcn fcn)
 
static VRF4API_METHOD
DtSimComponent
MarkThreadSafe (DtSimComponent *comp)
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 

Protected Member Functions

virtual bool createPorts ()
 
virtual void lookupAndCacheProcessSR ()
 
virtual bool calculateTrajectory (const DtVector &shooterLoc, const DtVector &detonationLoc, const double maxRange)
 
virtual void calculateTrajectoryWithHeight (double horizontalDist, double verticalDist, double maxHeight, double &muzzleSpeed, double &launchAngle, double &flightTime)
 
virtual bool calculateElevationAngle (double lateralDist, double verticalDist, double muzzleSpeed, double &angle, double &flightTime, double &maxHeight) const
 
virtual bool checkMuzzleSpeedAndAngle (double lateralDist, double verticalDist, double speed, double angle, double &flightTime, double &maxHeight) const
 
virtual void getMunitionResources (std::list< DtString > &resourceList)
 
virtual void updateResourceList ()
 
virtual DtVector computeLeadPosition (const DtVector &position, const DtVector &velocity)
 
virtual const DtVectormuzzleLocalPosition ()
 
virtual DtReaderWriterprocessProvideWeaponName ()
 
virtual double preferredAltitude () const
 
 DtIndirectFireWeaponController ()
 
 DtIndirectFireWeaponController (const DtIndirectFireWeaponController &orig)
 
const
DtIndirectFireWeaponController
operator= (const DtIndirectFireWeaponController &orig)
 
virtual void enable ()
 
virtual void disable ()
 
- Protected Member Functions inherited from DtBaseWeaponController
virtual bool createPortGroups ()
 
 DtBaseWeaponController ()
 
 DtBaseWeaponController (const DtBaseWeaponController &orig)
 
const DtBaseWeaponControlleroperator= (const DtBaseWeaponController &orig)
 
- Protected Member Functions inherited from DtControllerComponent
 DtControllerComponent ()
 
 DtControllerComponent (const DtControllerComponent &orig)
 
const DtControllerComponentoperator= (const DtControllerComponent &orig)
 
virtual void onRestore ()
 
virtual void initializeTargetingControlTableFromDescriptor (const DtReaderWriter *)
 
virtual void setRadio (DtSimRadio *radio)
 
virtual void sendCapableSetsAndTasks ()
 
- Protected Member Functions inherited from DtSimComponent
virtual double computeCurrentTime ()
 
bool testInvariant () const
 
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 
virtual void updateTaskVisualizations ()
 
virtual void destroyTaskVisualizations ()
 
virtual void destroyTaskVisualization (const DtString &name)
 
virtual
makVrf::DtPointTaskVisualizationPtr 
pointTaskVisualization (const DtString &name)
 
virtual
makVrf::DtLineTaskVisualizationPtr 
lineTaskVisualization (const DtString &name)
 
virtual
makVrf::DtAreaTaskVisualizationPtr 
areaTaskVisualization (const DtString &name)
 
virtual
makVrf::DtTextTaskVisualizationPtr 
textTaskVisualization (const DtString &name)
 
double calculateNextTaskVisTickTime () const
 
DtVrfObjectStateRepositorylocalStateRepository ()
 
const DtVrfObjectStateRepositorylocalStateRepository () const
 
void addSimObjectPredicateCallback (DtSimObjectReference, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void removeSimObjectPredicateCallback (const DtSimObject *, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void invokeSimObjectPredicateCallbacks ()
 
virtual void clearPredicateCallbacks ()
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

DtIndirectWeaponComponentInterfacemyWeaponComponentInterface
 
DtDetonatorFuze myFuzeToUse
 
DtReal myCurrentMuzzleSpeed
 
DtReal myCurrentMunitionFlightTime
 
DtReal myCurrentElevationAngle
 
bool myWeaponIsAimed
 
DtSimMunition myMunitionToUse
 
DtIndirectFireControllerDescriptormyIndFireDescriptor
 
Ports and Port Groups
DtVectorOutputPortmyTargetPointPort
 
DtAnalogOutputPortmyMuzzleSpeedPort
 
DtAnalogOutputPortmyAngleOfFirePort
 
DtBooleanOutputPortmyAlignedDirectlyPort
 
DtVectorInputPortmyMuzzleOffsetPort
 
DtMountingControllermyMountingController
 
bool myIsDirectFire
 
- Protected Attributes inherited from DtBaseWeaponController
bool myDoWeaponPreload
 
bool myWaitingForFire
 
DtReal myFireMaxVehicleSpeed
 
DtReal myMaxAzimuthAngleOffBoresight
 
DtReal myMaxElevationAngleOffBoresight
 
const
DtBaseWeaponControllerDescriptor
myBaseWeaponCtlrDesc
 
DtBaseMountingControllermyBaseMountingController
 
DtVrfWeaponPSRmyWeaponProcessState
 
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
 
DtOutputPortGroupmyWeaponOutputPortGroup
 
DtAmmunitionOutputPortmyLoadAmmunitionPort
 
DtBooleanOutputPortmyTriggerPort
 
DtBooleanOutputPortmyLoadedPort
 
DtInputPortGroupmyWeaponInputPortGroup
 
DtIntegerInputPortmyArtPartTypePort
 
- Protected Attributes inherited from DtControllerComponent
DtSimRadiomyRadio
 
bool myTaskTypesEnabled
 
bool myInitialized
 
- Protected Attributes inherited from DtSimComponent
DtLocalObjectmyEntity
 
DtComponentSystemmySystem
 
DtListItem * myListItem
 
DtInputPortMap myInputPortList
 
DtOutputPortMap myOutputPortList
 
DtInputPortGroupMap myInputPortGroupList
 
DtOutputPortGroupMap myOutputPortGroupList
 
int myPriority
 
double myMinTickPeriod
 
double myMinTickPeriodVariance
 
double myNextTickTime
 
double myLastTickSimTime
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
bool myTickEveryFrame
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManager myPredicateCallbackManager
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 
virtual void registerAttributeFunctions ()
 
static DtReaderWriterprovideWeaponName (void *controller)
 
virtual void processSetResource (DtSimMessage *msg)
 
static void setResourceCallback (DtSimMessage *msg, void *usrData)
 
virtual void processSetRestore (DtSimMessage *msg)
 
static void setRestoreCallback (DtSimMessage *msg, void *usrData)
 
virtual void processSetPreferredAltitude (DtSimMessage *msg)
 
static void setPreferredAltitudeCallback (DtSimMessage *msg, void *usrData)
 

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
 
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
 
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
 
typedef std::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 
- Protected Types inherited from DtSimComponent
typedef std::map< DtString,
DtInputPort * > 
DtInputPortMap
 
typedef std::map< DtString,
DtOutputPort * > 
DtOutputPortMap
 
typedef std::map< DtString,
DtInputPortGroup * > 
DtInputPortGroupMap
 
typedef std::map< DtString,
DtOutputPortGroup * > 
DtOutputPortGroupMap
 
- Static Protected Attributes inherited from DtSimComponent
static DtSimComponentFactorymyFactory
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Constructor & Destructor Documentation

DtIndirectFireWeaponController::DtIndirectFireWeaponController ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject 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).
virtual DtIndirectFireWeaponController::~DtIndirectFireWeaponController ( )
virtual

destructor

DtIndirectFireWeaponController::DtIndirectFireWeaponController ( )
protected

default constructor; not implemented

DtIndirectFireWeaponController::DtIndirectFireWeaponController ( const DtIndirectFireWeaponController orig)
protected

copy constructor; not implemented

Member Function Documentation

virtual const char* DtIndirectFireWeaponController::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. Warning: this function should always return the same pointer and it should be valid forever. This means the data should be static.

Returns
DtIndirectFireWeaponControllerType

Reimplemented from DtBaseWeaponController.

virtual bool DtIndirectFireWeaponController::init ( )
virtual

Overridden to initialize values obtained from the descriptor.

Reimplemented from DtBaseWeaponController.

virtual bool DtIndirectFireWeaponController::createMountingController ( )
virtual

Overridden to create a DtMountingController.

Reimplemented from DtBaseWeaponController.

virtual void DtIndirectFireWeaponController::preFirstTickInit ( )
virtual

Restores the checkpointed values of myCurrentMunition and myCurrentFuze from the the munition loader of the DtVrfBalGunPSR. Calls setDisplayName on myWeaponComponentInterface with the value from the PSR.

Reimplemented from DtBaseWeaponController.

virtual void DtIndirectFireWeaponController::tick ( )
virtual

Sets the current dT on the base mounting controller and ticks it.

Reimplemented from DtBaseWeaponController.

virtual bool DtIndirectFireWeaponController::createTargetPointPort ( )
virtual

Creates a new DtVectorPort named "target-point-port".

virtual DtVectorOutputPort* DtIndirectFireWeaponController::targetPointPort ( ) const
virtual

Accessor for the target point port.

virtual bool DtIndirectFireWeaponController::createMuzzleSpeedPort ( )
virtual

Creates a new DtAnalogPort named "muzzle-speed-port".

virtual DtAnalogOutputPort* DtIndirectFireWeaponController::muzzleSpeedPort ( ) const
virtual

Accessor for the muzzle speed port.

virtual bool DtIndirectFireWeaponController::createAngleOfFirePort ( )
virtual

Creates a new DtAnalogPort named "angle-of-fire-port".

virtual DtAnalogOutputPort* DtIndirectFireWeaponController::angleOfFirePort ( ) const
virtual

Accessor for the muzzle speed port.

virtual bool DtIndirectFireWeaponController::createAlignedDirectlyPort ( )
virtual

Creates a new DtBooleanPort named "aligned-directly-port".

virtual DtBooleanOutputPort* DtIndirectFireWeaponController::alignedDirectlyPort ( ) const
virtual

Accessor for the max range port.

virtual bool DtIndirectFireWeaponController::createMuzzleOffsetPort ( )
virtual

Creates a new DtVectorInputPort named "muzzle-offset-port".

virtual DtVectorInputPort* DtIndirectFireWeaponController::muzzleOffsetPort ( ) const
virtual

Accessor for the muzzle offset port.

static DtSimComponent* DtIndirectFireWeaponController::creator ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
static

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject 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).
Returns
New instance of this class.
virtual DtVrfIndirectFirePSR* DtIndirectFireWeaponController::indirectFireProcessState ( )
virtual
virtual const DtVrfIndirectFirePSR* DtIndirectFireWeaponController::indirectFireProcessState ( ) const
virtual
virtual void DtIndirectFireWeaponController::registerAttributeFunctions ( )
virtual

Attribute functions:Overrides the simComponent version to register the functions below.

Reimplemented from DtSimComponent.

static DtReaderWriter* DtIndirectFireWeaponController::provideWeaponName ( void *  controller)
static

Function to be registered as a provider with the parent component system for the weapon-name attribute. This name is used in indirect fire tasks (along with an optional munition name) to identify the entity weapon to fire. This distinction is needed when there are multiple weapons, e.g. ship turrets. Calls processProvideWeaponName.

virtual bool DtIndirectFireWeaponController::haveAmmo ( const DtString ammoName) const
virtual

Returns true if lookupMunitionResource() can locate a resource with the given ammoName && the resource is not empty.

virtual const DtString& DtIndirectFireWeaponController::findDefaultAmmo ( ) const
virtual

Goes through the ammo list in myIndFireDescriptor and returns the first ammo type for which haveAmmo() returns true.

virtual void DtIndirectFireWeaponController::getMunitionFromResourceName ( const DtString resourceName,
DtSimMunition munition 
) const
virtual

If lookupMunitionResource is able to locate the given resourceName, the given munition parameter will be assigned it's munitionType().

virtual DtMunitionResource* DtIndirectFireWeaponController::lookupMunitionResource ( const DtString resource) const
virtual

Attempts to locate the given resource in the entity's state repository, and if it is a DtMunitionResource, it will be returned.

virtual void DtIndirectFireWeaponController::setMyFuzeToUse ( DtDetonatorFuze  fuzeToUse)
virtual

mutator for myFuzeToUse

virtual DtDetonatorFuze DtIndirectFireWeaponController::fuzeToUse ( ) const
virtual

accessor for myFuzeToUse

virtual void DtIndirectFireWeaponController::setCurrentMuzzleSpeed ( DtReal  speed)
virtual

Set the current muzzle speed.

virtual DtReal DtIndirectFireWeaponController::currentMuzzleSpeed ( ) const
virtual

Get the current muzzle speed.

virtual void DtIndirectFireWeaponController::addRangeItems ( )
virtual
virtual bool DtIndirectFireWeaponController::initializeController ( const DtString ammoType,
DtReal  heightAboveTerrain,
const DtUUID targetName,
bool waitingForTerrain,
DtDetonatorFuze  fuseType,
bool  generateKnownTargetPoint = false,
const DtString knownTargetPointName = "" 
)
virtual

Sets up the controller with the given parameters. Called in preFirstTickInit to restore the controller if the task is being restored from a scenario load, and by tick() in response to a new fire task as signaled by weaponInterface->initializeWeapon.

virtual bool DtIndirectFireWeaponController::createPorts ( )
protectedvirtual

Overridden to call createTargetPointPort and createMaxRangePort.

Reimplemented from DtBaseWeaponController.

virtual void DtIndirectFireWeaponController::lookupAndCacheProcessSR ( )
protectedvirtual

This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in myWeaponProcessState. The name (if it exists) is given in the component descriptor (DtComponentDescriptor::processStateRepositoryName). If the name does not exist, it uses the appropriate default name defined in procSRTypes.h. Another component is responsible for creating and destroying the process state repository. Overridden from DtBaseWeaponController to print a warning if it can't be cast to the derived type of process state repository, DtVrfIndirectFirePSR.

Reimplemented from DtBaseWeaponController.

virtual bool DtIndirectFireWeaponController::calculateTrajectory ( const DtVector shooterLoc,
const DtVector detonationLoc,
const double  maxRange 
)
protectedvirtual

Calculates a trajectory for the munition in order to reach a specified detonation location from a specified shooter location, in local coordinates. Returns true if successful. Populates myCurrentMuzzleSpeed, myCurrentMunitionFlightTime, and myCurrentElevationAngle with the calculated values. Also calls setDesiredElevation on the mounting controller. If there is not a set list of muzzle speeds( i.e. various range trajectories) which is the case for grenades, will need to use range passed in to ensure say within max range capability of human throwing.

virtual void DtIndirectFireWeaponController::calculateTrajectoryWithHeight ( double  horizontalDist,
double  verticalDist,
double  maxHeight,
double muzzleSpeed,
double launchAngle,
double flightTime 
)
protectedvirtual

Calculates a trajectory for the munition in order to reach a target at the given horizontal and vertical distance from the shooter, with the peak of the arc happening at the specified height above the shooter.

virtual bool DtIndirectFireWeaponController::calculateElevationAngle ( double  lateralDist,
double  verticalDist,
double  muzzleSpeed,
double angle,
double flightTime,
double maxHeight 
) const
protectedvirtual

Calculates the gun elevation angle needed to hit a point at the given distance with the given muzzle speed. Fills in the flightTime and maxHeight of the trajectory. Returns false if no valid angle could be found.

virtual bool DtIndirectFireWeaponController::checkMuzzleSpeedAndAngle ( double  lateralDist,
double  verticalDist,
double  speed,
double  angle,
double flightTime,
double maxHeight 
) const
protectedvirtual

Determines the acceptability of a shot with the given muzzle speed and elevation angle for a target at the given lateral and vertical distance. If shot is acceptable, fills in flightTime with the expected munition flight time and maxHeight with the height at the peak of the trajectory.

virtual void DtIndirectFireWeaponController::getMunitionResources ( std::list< DtString > &  resourceList)
protectedvirtual

Called when setting up the weapon component interface. Gets all resources in the component that have amounts > 0.

virtual void DtIndirectFireWeaponController::updateResourceList ( )
protectedvirtual

Go through the resource list and remove any with amounts = 0.

static void DtIndirectFireWeaponController::setResourceCallback ( DtSimMessage msg,
void *  usrData 
)
staticprotected

A callback to updateResourceList() when resources are changed, just in case ammo is cleared or restored.

virtual void DtIndirectFireWeaponController::processSetResource ( DtSimMessage msg)
protectedvirtual

A callback to updateResourceList() when resources are changed, just in case ammo is cleared or restored.

static void DtIndirectFireWeaponController::setRestoreCallback ( DtSimMessage msg,
void *  usrData 
)
staticprotected

A callback to updateResourceList() when resources are changed, just in case ammo is cleared or restored.

virtual void DtIndirectFireWeaponController::processSetRestore ( DtSimMessage msg)
protectedvirtual

A callback to updateResourceList() when resources are changed, just in case ammo is cleared or restored.

static void DtIndirectFireWeaponController::setPreferredAltitudeCallback ( DtSimMessage msg,
void *  usrData 
)
staticprotected

Processes user commands to change the preferred altitude of the trajectory.

virtual void DtIndirectFireWeaponController::processSetPreferredAltitude ( DtSimMessage msg)
protectedvirtual

Processes user commands to change the preferred altitude of the trajectory.

virtual DtVector DtIndirectFireWeaponController::computeLeadPosition ( const DtVector position,
const DtVector velocity 
)
protectedvirtual

Computes a position in front of a moving target that the gun should hit given the flight time of the shell.

virtual const DtVector& DtIndirectFireWeaponController::muzzleLocalPosition ( )
protectedvirtual

Computes the current local muzzle position based on the data on the myMuzzleOffsetPort and the current position of the articulated part referenced on the myArtPartTypePort.

virtual DtReaderWriter* DtIndirectFireWeaponController::processProvideWeaponName ( )
protectedvirtual

Provides the display name (a new DtRwString) of the weapon component interface for this weapon.

virtual double DtIndirectFireWeaponController::preferredAltitude ( ) const
protectedvirtual

Returns the preferred altitude above shooter and target that the munition's trajectory should reach at its peak.

const DtIndirectFireWeaponController& DtIndirectFireWeaponController::operator= ( const DtIndirectFireWeaponController orig)
protected

assignment operator; not implemented

virtual void DtIndirectFireWeaponController::enable ( )
protectedvirtual

Is this component enabled or not. If enabled, component's tick function will be called, otherwise it will not. Default is true (enabled).

Reimplemented from DtSimComponent.

virtual void DtIndirectFireWeaponController::disable ( )
protectedvirtual

Is this component enabled or not. If enabled, component's tick function will be called, otherwise it will not. Default is true (enabled).

Reimplemented from DtSimComponent.

Member Data Documentation

DtIndirectWeaponComponentInterface* DtIndirectFireWeaponController::myWeaponComponentInterface
protected

Interface between this weapon controller and the entity's DtIndirectFireController.

DtDetonatorFuze DtIndirectFireWeaponController::myFuzeToUse
protected

Set based on height above terrain value.

DtReal DtIndirectFireWeaponController::myCurrentMuzzleSpeed
protected

The muzzle speed selected for the next shot.

DtReal DtIndirectFireWeaponController::myCurrentMunitionFlightTime
protected

The expected flight time for the next shot.

DtReal DtIndirectFireWeaponController::myCurrentElevationAngle
protected

The elevation angle selected for the next shot.

bool DtIndirectFireWeaponController::myWeaponIsAimed
protected

Whether the weapon is fully aimed at the target, or if adjustments still need to be made.

DtSimMunition DtIndirectFireWeaponController::myMunitionToUse
protected

This could just be a stack variable in tick, but since these are expensive to construct, we create on and reuse it.

DtIndirectFireControllerDescriptor* DtIndirectFireWeaponController::myIndFireDescriptor
protected
DtVectorOutputPort* DtIndirectFireWeaponController::myTargetPointPort
protected

Output Port Name: target-point-port
Output Port Description: Local position to fire at.
Output Port Range:
Output Port Default Value:
Output Group Parent:

DtAnalogOutputPort* DtIndirectFireWeaponController::myMuzzleSpeedPort
protected

Output Port Name: muzzle-speed-port
Output Port Description: Muzzle speed in m/s.
Output Port Range:
Output Port Default Value:
Output Group Parent:

DtAnalogOutputPort* DtIndirectFireWeaponController::myAngleOfFirePort
protected

Output Port Name: angle-of-fire-port
Output Port Description: The elevation angle of fire, in radians.
Output Port Range:
Output Port Default Value:
Output Group Parent:

DtBooleanOutputPort* DtIndirectFireWeaponController::myAlignedDirectlyPort
protected

Output Port Name: aligned-directly-port
Output Port Description: If the target is close enough for the gun to align directly with the target and the gun is capable of doing so let the actuator know so the fly out will come out straight not arched
Output Port Range:
Output Port Default Value: false
Output Group Parent:

DtVectorInputPort* DtIndirectFireWeaponController::myMuzzleOffsetPort
protected

Input Port Name: muzzle-offset-port
Input Port Description: The entity's muzzle offset location.
Input Port Range:
Input Port Default Value:
Input Group Parent:

DtMountingController* DtIndirectFireWeaponController::myMountingController
protected

Output Port Name: target-point-port
Output Port Description: Local position to fire at.
Output Port Range:
Output Port Default Value:
Output Group Parent:

bool DtIndirectFireWeaponController::myIsDirectFire
protected

If weapon is capable of directly firing on a target like a naval gun then check if the target is within the gun's minimum range and the first range entry. If so set this to true and the gun will not elevate for a parabolic artillery shot but will line up directly with the target.


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

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)