VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
searchLightController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
15 #include "vrfutil/scriptGeometry.h"
16 
17 namespace makVrf
18 {
19  class DtArticulatedPartStateRepository;
20 }
21 
22 class DtAnalogOutputPort;
23 class DtAnalogInputPort;
24 class DtIntegerInputPort;
26 class DtStringInputPort;
27 class DtStringOutputPort;
28 class DtVectorOutputPort;
29 class DtVectorInputPort;
31 class DtBooleanInputPort;
36 class DtVrfSearchLight;
37 
38 namespace makVrfEvents
39 {
40  class DtEvent;
41 }
42 
46  , public DtBindableLuaComponent<DtSearchLightController>
47 {
48 
49 public:
50 
53  DtSearchLightController(const DtString& name,
54  DtLocalObject* owner,
55  DtSimulationServices* simManager,
56  DtComponentDescriptor* desc = 0,
57  DtReaderWriterRegistry* parentRegistry = 0);
58 
60  virtual ~DtSearchLightController() override;
61 
62  virtual bool init() override;
63 
64  virtual bool postAddComponentsInit() override;
65 
68  virtual const char* type() const override;
69 
70  virtual void tick() override;
71 
73 
74  static void setAimSearchLightCallback(DtSimMessage * msg, void * usr);
75  virtual void processSetAimSearchLight(DtSimMessage* msg);
77 
79  virtual void clearTask() override;
80 
82 
83 
85  virtual std::string mode() const;
86 
88  virtual double orientation(double& elevation) const;
89 
91  virtual DtLocation3D lookingAt() const;
92 
94 
97  virtual void bindLuaFunctions(lua_State* L) override;
98  virtual void bindLuaGlobals(lua_State* L) override;
99 
103  static DtSimComponent * creator(const DtString& name,
104  DtLocalObject* owner,
105  DtSimulationServices* simManager,
106  DtComponentDescriptor* desc = 0,
107  DtReaderWriterRegistry* parentRegistry = 0);
108 
109 protected:
110 
112  virtual bool targetPoint(const DtTaitBryan& orientation, DtVector& location) const;
113  virtual DtVector localEyepoint() const;
114 
116  virtual bool createPortGroups() override;
117 
119  virtual bool createPorts() override;
120 
122  virtual DtSearchLightControllerPSR* createPSR();
123 
125  virtual void initSearchLight();
126 
127  DtVector bodySearchLightPosition() const;
128 
129  DtTaitBryan bodySearchLightOrientation() const;
130 
133  virtual void restoreDefaultAiming();
134 
136  virtual void aimSearchLightAtPoint(const DtVector& worldLocation);
137 
139  virtual void trackObject(const DtSimObject* objectToTrack);
140 
143  virtual void aimSearchLightAtAngle(double azimuth, double elevation);
144 
148  virtual void scanSearchLight();
149 
151  virtual void currentPositionAzimuthAndElevation(DtVector& offset, double& az, double& el) const;
152 
154  virtual void currentWorldLocationAndOrientation(DtVector& location, DtTaitBryan& orientation) const;
155 
157  virtual makVrf::DtArticulatedPartStateRepository* searchLightAzimuthArtPart();
158  virtual const makVrf::DtArticulatedPartStateRepository* searchLightAzimuthArtPart() const;
159 
161  virtual makVrf::DtArticulatedPartStateRepository* searchLightElevationArtPart();
162  virtual const makVrf::DtArticulatedPartStateRepository* searchLightElevationArtPart() const;
163 
166  virtual bool findLocationOfSearchLightAiming(const DtVector& searchLocation,
167  const DtTaitBryan& orientation, DtVector& aimingPoint) const;
168 
170  virtual double minAzimuth() const;
171 
173  virtual double maxAzimuth() const;
174 
176  virtual double minElevation() const;
177 
179  virtual double maxElevation() const;
180 
182  virtual bool isAnySearchLightOnEntity() const;
183 
186  virtual void updateSpotLightAppearanceBit();
187 
188 private:
189 
192 
195  DtSearchLightController & orig);
196 
199  const DtSearchLightController & orig);
200 
201 protected:
202 
204 
206 
209 
212 
215 
219 
222 
226 
228 
229 
234 
242 
250 
255 
261 
267 
273 
279 
287 
294 
301 
308 
315 
322 
325 };
double myLastSentAzimuth
Last sent azimuth and elevation sent to the actuator. Used to detect false positives with orientation...
Definition: searchLightController.h:216
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Instances of DtStringOutputPort are output ports through which data producers can send a DtString obj...
Definition: stringIOPort.h:52
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
DtInputPortGroup * mySearchLightLimitsPortGroup
Input Port Group Name: search-light-limits Input Port Group Description: Allows the actuator to commu...
Definition: searchLightController.h:254
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
DtBooleanInputPort * myOrientationAchievedInputPort
Input Port Name: orientation-achieved Input Port Description: Specifies whether the search light was ...
Definition: searchLightController.h:286
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
virtual void bindLuaFunctions(lua_State *)=0
Override to bind lua functions.
Contains class declarations for DtStringInputPort, DtStringOutputPort, and DtStringPortData.
Definition: stringIOPort.h:27
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
Definition: bindableLuaComponent.h:56
Contains class declarations for DtIntegerInputPort, DtIntegerOutputPort, and DtIntegerPortData.
Definition: integerIOPort.h:25
DtVrfSearchLight manages a VR-Link search light publisher, and sets all the values associated with a ...
Definition: vrfSearchLight.h:27
DtAnalogInputPort * myMaxElevationPort
Input Port Name: max-elevation Input Port Description: The maximum elevation at which the light can a...
Definition: searchLightController.h:278
DtVectorInputPort * myPositionInputPort
Input Port Name: position Input Port Description: Specifies the position of the search in body coordi...
Definition: searchLightController.h:249
Instances of DtSearchLightControllerDescriptor are used to specify the parameters for a DtSearchLight...
Definition: searchLightControllerDescriptor.h:20
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
double myLastSentElevation
Last sent azimuth and elevation sent to the actuator. Used to detect false positives with orientation...
Definition: searchLightController.h:217
DtIntegerOutputPort * myAzimuthRotationRatePercentagePort
Output Port Name: azimuth-rotation-rate-percentage Output Port Description: Percentage of maximum rot...
Definition: searchLightController.h:314
DtSearchLightControllerPSR * myProcessState
Definition: searchLightController.h:205
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
DtVrfSearchLight * mySearchLight
The field of view of the sensor.
Definition: searchLightController.h:208
DtAnalogOutputPort * myOrderedAzimuthPort
Output Port Name: ordered-azimuth Output Port Description: Azimuth at which to attempt to aim the lig...
Definition: searchLightController.h:300
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:29
File: simMsg.h.
Definition: simMessage.h:35
DtAnalogOutputPort * myOrderedElevationPort
Output Port Name: ordered-elevation Output Port Description: Elevation at which to attempt to aim the...
Definition: searchLightController.h:293
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation frame...
DtInputPortGroup * mySearchLightOffsetInputPortGroup
Input Port Group Name: search-light-offset Input Port Group Description: Allows the actuator to commu...
Definition: searchLightController.h:233
bool myDataNeededForAimingPoint
Whether the data is not yet loaded to find the aiming point.
Definition: searchLightController.h:211
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtSearchLightControllerPSR is a process state repository which holds state variables for the DtSearch...
Definition: searchLightControllerPSR.h:18
DtAnalogInputPort * myMinAzimuthPort
Input Port Name: min-azimuth Input Port Description: The minimum azimuth at which the light can aim...
Definition: searchLightController.h:260
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtAnalogInputPort * myMinElevationPort
Input Port Name: min-elevation Input Port Description: The minimum elevation at which the light can a...
Definition: searchLightController.h:272
This class is responsible for controlling the aiming of a search light. Uses Descriptor Type: DtCompo...
Definition: searchLightController.h:45
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
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:80
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
Input and output ports containing a DtTaitBryan.
Definition: orientationIOPort.h:26
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:40
const char int mode
Definition: ioapi.h:38
Contains class declarations for DtAnalogInputPort, DtAnalogOutputPort, and DtAnalogPortData.
Definition: analogIOPort.h:25
DtIntegerOutputPort * myElevationRotationRatePercentagePort
Output Port Name: elevation-rotation-rate-percentage Output Port Description: Percentage of maximum r...
Definition: searchLightController.h:307
DtBooleanOutputPort * myPowerOnPort
Output Port Name: power-on Output Port Description: Specifies whether the search light is enabled...
Definition: searchLightController.h:321
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: searchLightController.h:324
DtOrientationInputPort * myOrientationInputPort
Input Port Name: orientation Input Port Description: Specifies the orientation of the search relative...
Definition: searchLightController.h:241
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
virtual void bindLuaGlobals(lua_State *)=0
Override to bind lua globals.
voidpf uLong offset
Definition: ioapi.h:42
DtTaitBryan myWorldOrientationForAimingPoint
World location and orientation for determining the aiming point when data was not initially available...
Definition: searchLightController.h:224
DtSearchLightControllerDescriptor * mySearchLightDescriptor
Definition: searchLightController.h:203
A locally simulated VRF object.
Definition: localObject.h:98
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22
DtAnalogInputPort * myMaxAzimuthPort
Input Port Name: max-azimuth Input Port Description: The maximum azimuth at which the light can aim...
Definition: searchLightController.h:266
DtVector myWorldLocationForAimingPoint
World location and orientation for determining the aiming point when data was not initially available...
Definition: searchLightController.h:223

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)