|
VR-Engage
2.2
|
DtGunnerObserverUpdater attaches the observer to a weapon system and provides gunner-specific controls including zoom levels, sensor modes (visual, NVG, thermal), and appropriate gunner view positioning. It handles observer resets on player creation and manages smooth transitions between zoom levels.
#include <gunnerObserverUpdater.h>
Public Member Functions | |
| DtGunnerObserverUpdater () | |
| virtual | ~DtGunnerObserverUpdater () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtObserverUpdater | |
| DtObserverUpdater () | |
| virtual | ~DtObserverUpdater () override |
| virtual bool | postInitialize () override |
| virtual void | addChannelToUpdate (const std::string &windowName, const std::string &channelName) |
| virtual void | removeChannelToUpdate (const std::string &windowName, const std::string &channelName, bool restoreInitialSettings=true) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| virtual makVre::DtVreMessageResult | handlePlayerCreated (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handlePlayerReset (makVre::DtVreMessage *msg) |
| void | resetObserver () |
| void | updateSensor () |
| void | updateDestroyed () |
Protected Member Functions inherited from makVre::DtObserverUpdater | |
| virtual void | initializeStateAttributes () override |
| virtual void | onSensorModeChanged (std::string sensorMode) |
| virtual void | onObserverModeChanged (std::string observerMode) |
| virtual void | addDefaultChannels () |
| virtual void | addVrChannels () |
| virtual bool | findChannelConfiguration (const std::string &windowName, const std::string &channelName, makVrv::DtChannelConfiguration &config) |
| virtual void | updateAllChannels () |
| virtual void | setShowCockpits (bool show) |
| virtual bool | applyConfigurationToChannel (const std::string &windowName, const std::string &channelName, const makVrv::DtChannelConfiguration &newConfig) |
| bool | firstWindowAndChannelNames (std::string &windowName, std::string &channelName) |
| virtual void | updateStateAttributes () |
Protected Attributes | |
| bool | myAttached |
| makVrv::DtObserver * | myObserver |
| makVre::DtLinearInterpolator< double > * | myZoomInterpolator |
| int | myAttachPart |
| DtVector | myAttachedOffset |
| DtQuaternion | myOriOffest |
| SensorViews | myLastSensorViewMode |
| std::map< enum SensorViews, std::string > | mySensorModes |
Protected Attributes inherited from makVre::DtObserverUpdater | |
| makVre::DtInstrumentPanelManager * | myInstrumentPanelManager |
| ChannelConfigMap | myChannelsToUpdate |
| bool | myForceChannelUpdate |
| double | myVerticalFOV |
| double | myHorizontalFOV |
| makVrv::DtWindow * | myWindow |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
Additional Inherited Members | |
Protected Types inherited from makVre::DtObserverUpdater | |
| using | WindowAndChannelName = std::pair<std::string, std::string> |
| using | ChannelConfigMap = std::map<WindowAndChannelName, makVrv::DtChannelConfiguration> |
| makVre::DtGunnerObserverUpdater::DtGunnerObserverUpdater | ( | ) |
Constructor for DtGunnerObserverUpdater.
Initializes observer state variables including attachment status and sensor modes
|
overridevirtual |
Destructor for DtGunnerObserverUpdater.
|
overridevirtual |
Initializes the gunner observer updater component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing gunner observer settings |
Sets up observer attachments, configures sensor modes, and registers message handlers for player creation and reset events
Reimplemented from makVre::DtObserverUpdater.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Called every frame to update the gunner observer.
| dt | Delta time since the last frame in seconds |
Updates zoom interpolation, observer attachment properties, sensor modes, and handles special cases when the vehicle is destroyed
Reimplemented from makVre::DtObserverUpdater.
|
overridevirtual |
Shuts down the gunner observer updater component.
Removes message handlers, detaches the observer, and resets sensor modes
Reimplemented from makVre::DtObserverUpdater.
|
overridevirtual |
Returns the type identifier for this component.
Reimplemented from makVre::DtObserverUpdater.
|
protectedvirtual |
Handles player creation messages.
| msg | The player created message |
Resets the observer when a new player is created
|
protectedvirtual |
Handles player reset messages.
| msg | The reset message |
Resets the observer when the player is reset
|
protected |
Resets the observer to the proper attachment point and orientation.
Configures the observer to attach to the correct part of the entity with the appropriate offset and rotation settings
|
protected |
Updates the observer's sensor mode based on player state.
Changes sensor modes (visual, NVG, thermal) when the player's currentSensor attribute changes
|
protected |
Updates observer behavior when the vehicle is destroyed.
Changes observer attachment type and resets when destruction state changes
|
protected |
Flag indicating if the observer is attached to a scene object.
|
protected |
Pointer to the observer object being controlled.
|
protected |
Interpolator for smooth zoom level transitions.
|
protected |
ID of the part to attach the observer to (e.g., gun barrel)
|
protected |
Position offset from the attachment point.
|
protected |
Orientation offset from the attachment point.
|
protected |
Currently active sensor view mode.
|
protected |
Map of SensorViews enums to VR-Engage sensor mode names.
This map is initialized with data from the player configuration and maps the SensorViews enumeration values to their corresponding string names used in VR-Vantage