|
VR-Engage
2.2
|
DtBinocularsOverlay provides a specialized overlay for binoculars view, displaying reticle markings and managing post-processing effects. It handles display visibility based on player state, equipment, and view mode. The component supports both standard and VR viewing modes, automatically adjusting reticle dimensions based on viewport and zoom settings.
#include <vreBinocularsOverlay.h>
Public Member Functions | |
| DtBinocularsOverlay (const std::string &className="DtBinocularsOverlay") | |
| virtual | ~DtBinocularsOverlay () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual bool | isOverlayVisible () |
| void | setReticleHeight (float height) |
| void | setVisible (bool visible) |
Public Member Functions inherited from makVre::DtQtQuickOverlay | |
| DtQtQuickOverlay () | |
| virtual | ~DtQtQuickOverlay () override |
| virtual void | setRoot (QQuickItem *root) |
| virtual void | initdoc (QQuickItem *root) |
| virtual DtVreMessageResult | handleEnterPlayerState (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleExitPlayerState (DtVreMessage *msg) |
| virtual void | setVisibility (bool visible) |
| virtual bool | isVisible () |
| virtual void | setMenuState (bool on) |
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 void | computeReticleDimensions () |
| virtual void | slot_channelConfigurationModified (const std::string &deName, const std::string &winName, const std::string &oldChannelName, const makVrv::DtChannelConfiguration &config) |
| virtual void | slot_channelDestroyed (makVrv::DtChannelManager *channelManager, makVrv::DtChannel *channel) |
Protected Member Functions inherited from makVre::DtQtQuickOverlay | |
| virtual void | updateVals (double dt) |
| virtual void | disconnect () |
| virtual bool | buildConnections (DtInitTable &connections) |
| virtual void | onVisibilityAttributeChanged (bool on) |
| virtual void | removeModelSetAndSkyFromChannel () |
| virtual void | restoreModelSetAndSkyToChannel () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| float | myReticleTotalMils |
| bool | myUsePostEffect |
| makVrv::DtOsgChannel * | myChannel |
| makVre::DtInitTable | myConfig |
Protected Attributes inherited from makVre::DtQtQuickOverlay | |
| DtInitTable | myBindQmlPropertyToAttribute |
| QQuickItem * | myRoot |
| std::string | myTargetWindow |
| std::vector< Connection > | myConnections |
| std::string | myQmlFile |
| std::string | myQmlDataItemName |
| bool | myIsInMenuState |
| bool | myCachedVisibility |
| DtAttributeHandleType< bool > | myVisibilityAttribute |
| bool | myRenderOverlayOnly |
| bool | myWantSceneHidden |
| makVrv::DtOsgChannel * | myChannel |
| makVrv::DtObserverObject * | myObserver |
| QObject | myQObject |
| bool | myHasTickFunction |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtBinocularsOverlay::DtBinocularsOverlay | ( | const std::string & | className = "DtBinocularsOverlay" | ) |
Constructor for DtBinocularsOverlay.
| className | Class name for identification, defaults to "DtBinocularsOverlay" |
Initializes the component with default reticle settings
|
overridevirtual |
Virtual destructor for DtBinocularsOverlay.
|
overridevirtual |
Initializes the binoculars overlay component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing overlay settings |
Reads configuration values for reticle dimensions and sets up channel configuration change signals
Reimplemented from makVre::DtQtQuickOverlay.
Reimplemented in makVre::DtBinocularsLasingOverlay, and makVre::DtBinocularsZoomOverlay.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization after all components are initialized.
Sets up VR-specific configurations if applicable and initializes post-processing effect settings
Reimplemented from makVre::DtQtQuickOverlay.
Reimplemented in makVre::DtBinocularsLasingOverlay, and makVre::DtBinocularsZoomOverlay.
|
overridevirtual |
Called every frame to update the overlay state.
| dt | Delta time since the last frame in seconds |
Updates visibility and manages post-processing effects based on current overlay visibility state
Reimplemented from makVre::DtQtQuickOverlay.
Reimplemented in makVre::DtBinocularsLasingOverlay, and makVre::DtBinocularsZoomOverlay.
|
overridevirtual |
Shuts down the binoculars overlay component.
Disconnects signals and removes any post-processing effects
Reimplemented from makVre::DtQtQuickOverlay.
Reimplemented in makVre::DtBinocularsLasingOverlay.
|
overridevirtual |
Returns the type identifier for this component.
Reimplemented from makVre::DtQtQuickOverlay.
Reimplemented in makVre::DtBinocularsLasingOverlay, and makVre::DtBinocularsZoomOverlay.
|
virtual |
Determines if the overlay should be visible.
Checks player status, health, posture, and equipment to decide if the binoculars overlay should be shown
Reimplemented in makVre::DtBinocularsLasingOverlay, and makVre::DtBinocularsZoomOverlay.
| void makVre::DtBinocularsOverlay::setReticleHeight | ( | float | height | ) |
Sets the height of the binoculars reticle.
| height | Height value for the reticle in screen units |
Updates the reticle height property in the QML overlay
| void makVre::DtBinocularsOverlay::setVisible | ( | bool | visible | ) |
Sets the visibility state of the overlay.
| visible | True to show the overlay, false to hide it |
Updates the visible property in the QML overlay
|
protectedvirtual |
Calculates the dimensions of the reticle based on current view settings.
Computes reticle size based on channel projection, viewport dimensions, and zoom settings, with special handling for VR mode
|
protectedvirtual |
Slot called when a channel configuration is modified.
| deName | Name of the display engine |
| winName | Name of the window containing the channel |
| oldChannelName | Previous name of the channel |
| config | New channel configuration |
Recalculates reticle dimensions when channel configuration changes
|
protectedvirtual |
Slot called when a channel is about to be destroyed.
| channelManager | Pointer to the channel manager |
| channel | Pointer to the channel being destroyed |
Clears the channel reference if our tracked channel is being destroyed
|
protected |
Total size of the reticle in mils.
|
protected |
Flag indicating whether post-processing effects should be used.
|
protected |
Pointer to the channel used for rendering.
|
protected |
Cached configuration table for accessing settings during runtime.