VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aimWeaponController.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2023 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
15 
17 class DtInputPortGroup;
18 class DtVectorInputPort;
19 class DtBooleanInputPort;
20 class DtAnalogInputPort;
21 class DtAnalogOutputPort;
25 
26 namespace makVrf
27 {
28  class DtArticulatedPartStateRepository;
29 }
30 
35 {
36 public:
37 
40  DtAimWeaponController( const DtString& name, DtLocalObject* owner,
41  DtSimulationServices* simManager, DtComponentDescriptor* desc = 0,
42  DtReaderWriterRegistry* parentRegistry = 0);
43 
45  virtual ~DtAimWeaponController();
46 
47  virtual bool init();
48 
51  virtual bool postAddComponentsInit();
52 
55  virtual const char* type() const;
56 
57  virtual void tick();
58 
62  static DtSimComponent* creator( const DtString& name, DtLocalObject* owner,
63  DtSimulationServices* simManager, DtComponentDescriptor* desc = 0,
64  DtReaderWriterRegistry* parentRegistry = 0 );
65 
66 protected:
67 
69  virtual bool createPortGroups();
70 
72  virtual bool createPorts();
73 
81  virtual void lookupAndCacheProcessSR();
82 
85  virtual bool hasNewAimInput();
86 
103  virtual double periodicToNumberLine( const double testBearing,
104  double& leftBearing, double& rightBearing );
105 
106 private:
107 
110 
113 
116 
117 protected:
118 
120 
122 
123 
127 
134 
141 
147 
153 
161 
169 
177 
184 
193 
200 
201 
207 
213 
220 
222 
229 
233 
236 
237 };
DtAnalogInputPort * myAimAzimuthInputPort
Input Port Name: aim-azimuth Input Port Description: The azimuth at which to aim the weapon...
Definition: aimWeaponController.h:146
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtIntegerOutputPort * myLifeformWeaponStatePort
Output Port Name: weapon-state Output Port Description: Output Port Range: Output Port Default Valu...
Definition: aimWeaponController.h:219
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
DtInputPortGroup * myAimWeaponControlPortGroup
Input Port Group Name: aim-weapon-control Input Port Group Description: .
Definition: aimWeaponController.h:126
DtAnalogInputPort * myAimElevationInputPort
Input Port Name: aim-elevation Input Port Description: The elevation at which to aim the weapon...
Definition: aimWeaponController.h:152
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
DtBooleanInputPort * myForbidTurnPort
Input Port Name: forbid-turn Input Port Description: Indicates whether the entity can be turned to fa...
Definition: aimWeaponController.h:160
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
DtBooleanOutputPort * myBaseAimAtAnglePort
Output Port Name: base-aim-at-angle Output Port Description: Expected to be connected to the aim-at-a...
Definition: aimWeaponController.h:192
DtAimWeaponControllerDescriptor * myAimWeaponDescriptor
Definition: aimWeaponController.h:119
File: turBalGunPSR.h.
Definition: vrfTurretedBalGunPSR.h:26
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
virtual bool init() override
Calls setRadio()
bool myLastInAzimuthRange
Remembers whether the target location was in range last tick or not. To control message printing...
Definition: aimWeaponController.h:232
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
DtBooleanOutputPort * myWeaponAimedPort
Output Port Name: weapon-aimed Output Port Description: True if the weapon is currently aimed at a ta...
Definition: aimWeaponController.h:199
DtBooleanInputPort * myAimAtAnglePort
Input Port Name: aim-at-angle Input Port Description: Indicates that aiming should be done using the ...
Definition: aimWeaponController.h:140
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
DtVectorInputPort * myAimPointPort
Input Port Name: aim-point Input Port Description: Local position to aim at. Input Port Range: Input...
Definition: aimWeaponController.h:133
DtAnalogOutputPort * myAimElevationOutputPort
Output Port Name: aim-elevation-output Output Port Description: The elevation at which to aim the wea...
Definition: aimWeaponController.h:206
DtVrfTurretedBalGunPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: aimWeaponController.h:228
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtAnalogOutputPort * myAimAzimuthOutputPort
Output Port Name: aim-azimuth-output Output Port Description: The azimuth at which to aim the weapon...
Definition: aimWeaponController.h:212
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: aimWeaponController.h:235
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
DtAnalogOutputPort * myFaceDirectionPort
Output Port Name: face-direction Output Port Description: The direction that the system (or body) tha...
Definition: aimWeaponController.h:183
DtBooleanInputPort * myAllowAzimuthAimingPort
Input Port Name: allow-azimuth-aiming Input Port Description: Indicates whether we should perform azi...
Definition: aimWeaponController.h:176
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
Contains class declarations for DtAnalogInputPort, DtAnalogOutputPort, and DtAnalogPortData.
Definition: analogIOPort.h:25
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
DtBooleanInputPort * myAllowElevationAimingPort
Input Port Name: allow-elevation-aiming Input Port Description: Indicates whether we should perform e...
Definition: aimWeaponController.h:168
Instances of DtAimWeaponControllerDescriptor are used to specify the parameters for a DtAimWeaponCont...
Definition: aimWeaponControllerDescriptor.h:17
This class is responsible for controlling the aiming of a weapon at a target point. Uses Descriptor Type: DtAimWeaponControllerDescriptor.
Definition: aimWeaponController.h:34
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)