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;
26 
27 namespace makVrf
28 {
29  class DtArticulatedPartStateRepository;
30 }
31 
36 {
37 public:
38 
41  DtAimWeaponController( const DtString& name, DtLocalObject* owner,
42  DtSimulationServices* simManager, DtComponentDescriptor* desc = 0,
43  DtReaderWriterRegistry* parentRegistry = 0);
44 
46  virtual ~DtAimWeaponController() override;
47 
48  virtual bool init() override;
49 
52  virtual bool postAddComponentsInit() override;
53 
56  virtual const char* type() const override;
57 
58  virtual void tick() override;
59 
63  static DtSimComponent* creator( const DtString& name, DtLocalObject* owner,
64  DtSimulationServices* simManager, DtComponentDescriptor* desc = 0,
65  DtReaderWriterRegistry* parentRegistry = 0 );
66 
67 protected:
68 
70  virtual bool createPortGroups() override;
71 
73  virtual bool createPorts() override;
74 
82  virtual void lookupAndCacheProcessSR();
83 
90  virtual bool canFaceTarget(const DtRwLocationReference& target, DtString& reasonOut) const;
91 
94  virtual bool hasNewAimInput();
95 
112  virtual double periodicToNumberLine( const double testBearing,
113  double& leftBearing, double& rightBearing );
114 
115 private:
116 
119 
122 
125 
126 protected:
127 
129 
131 
132 
136 
143 
150 
156 
162 
170 
178 
185 
194 
201 
202 
208 
214 
221 
223 
230 
234 
237 
238 };
DtAnalogInputPort * myAimAzimuthInputPort
Input Port Name: aim-azimuth Input Port Description: The azimuth at which to aim the weapon...
Definition: aimWeaponController.h:155
#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:220
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:135
DtAnalogInputPort * myAimElevationInputPort
Input Port Name: aim-elevation Input Port Description: The elevation at which to aim the weapon...
Definition: aimWeaponController.h:161
Holds a position of some form. May be an absolute position, or a reference to another object...
Definition: rwLocationReference.h:25
DtBooleanInputPort * myForbidTurnPort
Input Port Name: forbid-turn Input Port Description: Indicates whether the entity can be turned to fa...
Definition: aimWeaponController.h:169
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
virtual const char * type() const override=0
This returns a string from compTypes.h, and identifies the type of component.
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:193
DtAimWeaponControllerDescriptor * myAimWeaponDescriptor
Definition: aimWeaponController.h:128
File: turBalGunPSR.h.
Definition: vrfTurretedBalGunPSR.h:29
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:233
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:200
DtBooleanInputPort * myAimAtAnglePort
Input Port Name: aim-at-angle Input Port Description: Indicates that aiming should be done using the ...
Definition: aimWeaponController.h:149
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation frame...
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:142
DtAnalogOutputPort * myAimElevationOutputPort
Output Port Name: aim-elevation-output Output Port Description: The elevation at which to aim the wea...
Definition: aimWeaponController.h:207
DtVrfTurretedBalGunPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: aimWeaponController.h:229
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:213
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:236
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:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
DtAnalogOutputPort * myFaceDirectionPort
Output Port Name: face-direction Output Port Description: The direction that the system (or body) tha...
Definition: aimWeaponController.h:184
DtBooleanInputPort * myAllowAzimuthAimingPort
Input Port Name: allow-azimuth-aiming Input Port Description: Indicates whether we should perform azi...
Definition: aimWeaponController.h:177
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
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:35
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)