|
VR-Engage
2.2
|
This component manages the spectator's observer (camera) within the simulation, controlling viewing position, orientation, and behavior. It handles observer initialization, updates its position and orientation each frame, and responds to events such as player creation and reset. The observer updater provides features specific to the spectator role, such as free-camera movement and point-of-interest focus capabilities.
#include <observerUpdater.h>
Public Member Functions | |
| DtSpectatorObserverUpdater () | |
| virtual | ~DtSpectatorObserverUpdater () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::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 | updateObserverOffsets () |
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 | |
| makVrv::DtObserver * | myObserver |
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::DtSpectatorObserverUpdater::DtSpectatorObserverUpdater | ( | ) |
Default constructor.
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initializes the observer updater component.
| player | Pointer to the player station |
| config | Reference to the initialization configuration |
Sets up the spectator observer and registers message handlers
Reimplemented from makVre::DtObserverUpdater.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Updates observer state each frame.
| dt | Delta time since the last update in seconds |
Updates the observer's position and orientation based on inputs and simulation state
Reimplemented from makVre::DtObserverUpdater.
|
overridevirtual |
Performs cleanup when the component is shut down.
Releases resources and unregisters message handlers
Reimplemented from makVre::DtObserverUpdater.
|
overridevirtual |
Returns the component type identifier.
Reimplemented from makVre::DtObserverUpdater.
|
protectedvirtual |
Handles player created messages.
| msg | Pointer to the message being processed |
Initializes the observer when a new player is created
|
protectedvirtual |
Handles player reset messages.
| msg | Pointer to the message being processed |
Resets the observer when the player is reset
|
protected |
Resets the observer to its default state.
Returns the observer to its initial position and orientation
|
protected |
Updates the observer offset values.
Adjusts position and orientation offsets based on current observer state
|
protected |
Pointer to the observer being managed.