|
VR-Engage
2.2
|
DtObserverUpdater provides common functionality for managing observer view settings, including field of view and view modes. It manages channel configurations for windows and synchronizes sensor modes between VR-Engage and VR-Vantage. This class serves as a base for more specialized observer updater components.
#include <observerUpdater.h>
Public Member Functions | |
| DtObserverUpdater () | |
| virtual | ~DtObserverUpdater () override |
| virtual bool | initialize (DtPlayerStation *station, DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const 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 Types | |
| using | WindowAndChannelName = std::pair<std::string, std::string> |
| using | ChannelConfigMap = std::map<WindowAndChannelName, makVrv::DtChannelConfiguration> |
Protected Member Functions | |
| 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 | |
| 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 |
|
protected |
Type definition for window and channel name pairs.
|
protected |
Type definition for mapping window/channel pairs to configurations.
| makVre::DtObserverUpdater::DtObserverUpdater | ( | ) |
Default constructor for DtObserverUpdater.
Initializes the component with the default name "DtObserverUpdater"
|
overridevirtual |
Virtual destructor for DtObserverUpdater.
|
overridevirtual |
Initializes the observer updater component.
| station | Pointer to the player station this component belongs to |
| config | Configuration table containing observer settings |
Sets up field of view parameters, and adds default channels to be managed by this component
Reimplemented from makVre::DtPlayerComponent.
Reimplemented in DtPilotObserverUpdater, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtGunnerObserverUpdater, makVre::DtHumanObserverUpdater, makVre::DtLookAroundObserverUpdater, makVre::DtSavedViewUpdater, and makVre::DtSpectatorObserverUpdater.
|
overridevirtual |
Performs post-initialization after all components are initialized.
Sets up callbacks for sensor mode and observer mode changes
Reimplemented from makVre::DtPlayerComponent.
Reimplemented in makVre::DtHumanObserverUpdater, and makVre::DtLookAroundObserverUpdater.
|
overridevirtual |
Called every frame to update observer parameters.
| dt | Delta time since the last frame in seconds |
Updates all managed channels and player state attributes
Implements makVre::DtPlayerComponent.
Reimplemented in DtPilotObserverUpdater, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtGunnerObserverUpdater, makVre::DtHumanObserverUpdater, makVre::DtLookAroundObserverUpdater, makVre::DtSavedViewUpdater, and makVre::DtSpectatorObserverUpdater.
|
overridevirtual |
Shuts down the observer updater component.
Removes attribute callbacks and restores original channel settings
Reimplemented from makVre::DtPlayerComponent.
Reimplemented in DtPilotObserverUpdater, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtGunnerObserverUpdater, makVre::DtHumanObserverUpdater, makVre::DtLookAroundObserverUpdater, makVre::DtSavedViewUpdater, and makVre::DtSpectatorObserverUpdater.
|
overridevirtual |
Returns the component type identifier.
Implements makVre::DtPlayerComponent.
Reimplemented in DtPilotObserverUpdater, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtGunnerObserverUpdater, makVre::DtHumanObserverUpdater, makVre::DtLookAroundObserverUpdater, makVre::DtSavedViewUpdater, and makVre::DtSpectatorObserverUpdater.
|
virtual |
Adds a channel to be managed by this updater.
| windowName | Name of the window containing the channel |
| channelName | Name of the channel to add |
Stores the initial configuration of the channel and marks it for updates
|
virtual |
Removes a channel from being managed by this updater.
| windowName | Name of the window containing the channel |
| channelName | Name of the channel to remove |
| restoreInitialSettings | If true, restores the channel's initial configuration |
Stops managing the specified channel and optionally restores its initial settings
|
overrideprotectedvirtual |
Initializes player state attributes related to observer settings.
Sets up field of view attributes and configures the initial channel projection
Reimplemented from makVre::DtPlayerComponent.
|
protectedvirtual |
Handles changes to the sensor mode state attribute.
| sensorMode | New sensor mode value |
Updates the observer's sensor mode in VR-Vantage when the sensorMode attribute changes
|
protectedvirtual |
Handles changes to the observer mode state attribute.
| observerMode | New observer mode value |
Updates the observer's view mode in VR-Vantage when the observerMode attribute changes
|
protectedvirtual |
Adds the default channel (Window 1, Channel 1) to be managed.
Adds the first window's Channel 1 to configurations to monitor. Derived classes can override this function to change this behavior.
|
protectedvirtual |
Adds VR-specific channels to be managed.
Adds HMD window channels for left and right eyes to be managed by this updater
|
protectedvirtual |
Finds the configuration for a specific channel.
| windowName | Name of the window containing the channel |
| channelName | Name of the channel to find |
| config | Output parameter that will receive the channel configuration |
Retrieves the current configuration of the specified channel
|
protectedvirtual |
Updates all managed channels with current settings.
Applies appropriate settings to all managed channels based on the display layout
|
protectedvirtual |
Sets the showCockpits keyword on all managed channels.
| show | True to show cockpits, false to hide them |
Adds or removes the "showCockpits" keyword from channel configurations
|
protectedvirtual |
Applies a configuration to a specific channel.
| windowName | Name of the window containing the channel |
| channelName | Name of the channel to configure |
| newConfig | New configuration to apply to the channel |
Modifies a channel's configuration through the window manager
|
protected |
Gets the names of the first window and channel.
| windowName | Output parameter that will receive the window name |
| channelName | Output parameter that will receive the channel name |
Finds and returns the names of the first window and its first channel
|
protectedvirtual |
Updates player state attributes with current observer data.
Updates position, orientation, and view attributes based on the current observer state
Reimplemented in makVre::DtHumanObserverUpdater.
|
protected |
Pointer to the instrument panel manager.
|
protected |
Map of channel configurations to be updated.
Stores the initial configuration of each managed channel, keyed by window name and channel name pairs
|
protected |
Flag indicating if channel updates should be forced.
|
protected |
Vertical field of view in degrees.
|
protected |
Horizontal field of view in degrees.
|
protected |
Pointer to the main window.