VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtSpectatorObserverUpdater Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtSpectatorObserverUpdater:
[legend]

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 DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () 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::DtInstrumentPanelManagermyInstrumentPanelManager
 
ChannelConfigMap myChannelsToUpdate
 
bool myForceChannelUpdate
 
double myVerticalFOV
 
double myHorizontalFOV
 
makVrv::DtWindow * myWindow
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
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>
 

Constructor & Destructor Documentation

◆ DtSpectatorObserverUpdater()

makVre::DtSpectatorObserverUpdater::DtSpectatorObserverUpdater ( )

Default constructor.

◆ ~DtSpectatorObserverUpdater()

virtual makVre::DtSpectatorObserverUpdater::~DtSpectatorObserverUpdater ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtSpectatorObserverUpdater::initialize ( makVre::DtPlayerStation * player,
makVre::DtInitTable & config )
overridevirtual

Initializes the observer updater component.

Parameters
playerPointer to the player station
configReference to the initialization configuration
Returns
True if initialization was successful, false otherwise

Sets up the spectator observer and registers message handlers

Reimplemented from makVre::DtObserverUpdater.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void makVre::DtSpectatorObserverUpdater::tick ( double dt)
overridevirtual

Updates observer state each frame.

Parameters
dtDelta time since the last update in seconds

Updates the observer's position and orientation based on inputs and simulation state

Reimplemented from makVre::DtObserverUpdater.

◆ shutdown()

virtual void makVre::DtSpectatorObserverUpdater::shutdown ( )
overridevirtual

Performs cleanup when the component is shut down.

Releases resources and unregisters message handlers

Reimplemented from makVre::DtObserverUpdater.

◆ type()

virtual const char * makVre::DtSpectatorObserverUpdater::type ( ) const
overridevirtual

Returns the component type identifier.

Returns
The component type string

Reimplemented from makVre::DtObserverUpdater.

◆ handlePlayerCreated()

virtual makVre::DtVreMessageResult makVre::DtSpectatorObserverUpdater::handlePlayerCreated ( makVre::DtVreMessage * msg)
protectedvirtual

Handles player created messages.

Parameters
msgPointer to the message being processed
Returns
Message processing result

Initializes the observer when a new player is created

◆ handlePlayerReset()

virtual makVre::DtVreMessageResult makVre::DtSpectatorObserverUpdater::handlePlayerReset ( makVre::DtVreMessage * msg)
protectedvirtual

Handles player reset messages.

Parameters
msgPointer to the message being processed
Returns
Message processing result

Resets the observer when the player is reset

◆ resetObserver()

void makVre::DtSpectatorObserverUpdater::resetObserver ( )
protected

Resets the observer to its default state.

Returns the observer to its initial position and orientation

◆ updateObserverOffsets()

void makVre::DtSpectatorObserverUpdater::updateObserverOffsets ( )
protected

Updates the observer offset values.

Adjusts position and orientation offsets based on current observer state

Member Data Documentation

◆ myObserver

makVrv::DtObserver* makVre::DtSpectatorObserverUpdater::myObserver
protected

Pointer to the observer being managed.


The documentation for this class was generated from the following file: