VR-Forces 4.0.4 Class Documentation
include/vrfmodel/balGun.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2003 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: balGun.h,v $ $Revision: 1.31 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00013 
00014 #ifndef DtBallisticGun_H_
00015 #define DtBallisticGun_H_
00016 
00017 #include "vrfobjcore/actCmpnt.h"
00018 #include <vl/fireInter.h>
00019 #include <vl/detonateInter.h>
00020 #include "vrfcore/timer.h"
00021 #include <vl/hostStructs.h>
00022 
00023 class DtSimManager;
00024 class DtBallisticGunDescriptor;
00025 class DtVrfObject;
00026 class DtVrfBalGunPSR;
00027 class DtDetonationDescriptor;
00028 class DtIntegerInputPort;
00029 class DtAmmunitionInputPort;
00030 class DtBooleanInputPort;
00031 class DtInputPortGroup;
00032 
00044 #include "vrfmodel/vrfmodelDefines.h"
00045 class DT_DLL_vrfmodel DtBallisticGun : public DtActuatorComponent
00046 {
00047 
00048 public:
00049 
00052    DtBallisticGun(const DtString& name, 
00053       DtVrfObject* owner,
00054       DtSimManager* simManager, 
00055       DtComponentDescriptor* desc = 0,
00056       DtReaderWriterRegistry* parentRegistry = 0);
00057 
00058 
00060    virtual ~DtBallisticGun();
00061 
00062    virtual bool init();
00063 
00070    virtual void initPendingDetonations();
00071 
00074    virtual DtString type() const;
00075 
00077    virtual void tick();
00078 
00090    virtual bool checkHitProbability(const DtEntityType& type, DtReal 
00091       range);
00092 
00097    virtual double hitProbabilityModifier(const DtEntityType& type, DtReal 
00098       range);
00099    
00108    virtual DtFireInteraction * createFireInteraction();
00109 
00130    virtual DtDetonationInteraction * createDetonationInteraction(DtTime& 
00131       detTime, bool assureMiss = false);
00132 
00147    virtual void scheduleDetonation(DtDetonationInteraction * detInter,
00148       DtTime detTime);
00149 
00150    virtual DtString probabilityString() const;
00151 
00153    virtual DtVector calculateMuzzlePosition() const;
00154 
00160    virtual DtDetonationInteraction * createDetonationInteraction(
00161       const DtDetonationDescriptor& desc, DtTime& detTime);
00162 
00165    virtual DtDetonationDescriptor* createDetonationDescriptor(
00166       DtDetonationInteraction* detInter, DtTime simTime);
00167 
00168 public:
00169 
00177    static void detonationCallback(DtTimer * timer);
00178 
00182    static DtSimComponent * creator(const DtString& name, 
00183       DtVrfObject* owner,
00184       DtSimManager* simManager, 
00185       DtComponentDescriptor* desc = 0,
00186       DtReaderWriterRegistry* parentRegistry = 0);
00187 
00189    static void objectAddedCb(DtVrfObject * vrfObject, void * usr);
00190 
00191 protected:
00192    
00194    virtual bool createPortGroups();
00195 
00197    virtual bool createPorts();
00198 
00204    virtual bool createPSR();
00205 
00210    virtual void processObjectAdded(DtVrfObject * vrfObject);
00211 
00213    virtual void addRangeItems();
00214 
00215 protected:
00216    
00218    DtBallisticGun();
00219 
00221    DtBallisticGun(const DtBallisticGun & orig);
00222 
00224    const DtBallisticGun & operator=(const DtBallisticGun & orig);
00225 
00226 protected:
00227    DtBallisticGunDescriptor    * myBalGunDescriptor;
00228    DtEntityIdentifier                    myObjectId;
00229 
00230    DtReal             myMuzzleSpeed;
00231    DtVector           myMuzzleOffset;
00232 
00235    DtVrfObject *      myCurrentTarget;
00236    DtEventId          myCurrentEventId;
00237    DtReal             myCurrentRange;
00238 
00239    DtList             myTimerList;
00240    DtArtPartType      myGunArtPart;
00241 
00244    DtVrfBalGunPSR*    myProcessState;
00245 
00246    bool myFirstTick;
00247 
00250 
00253    DtInputPortGroup      *myBalGunControlPortGroup;
00254 
00261    DtBooleanInputPort    *myTriggerPort;
00262 
00271    DtIntegerInputPort*  myQuantityInputPort;
00272 
00278    DtBooleanInputPort    *myLoadedPort;
00279 
00288    DtIntegerInputPort          *myLosPort;
00289 
00291 };
00292 
00293 #endif

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)