|
VR-Engage
2.2
|
DtBinocularsSimLogic manages binoculars zoom operations, handling zoom messages and maintaining the current view magnification state. It provides specialized functionality for VR environments, including head orientation smoothing when using binoculars. The component supports both direct zoom-to values and incremental zoom changes.
#include <vreBinocularsSimLogic.h>
Public Member Functions | |
| DtBinocularsSimLogic () | |
| virtual | ~DtBinocularsSimLogic () 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 makVre::DtVreMessageResult | handleZoomToEvent (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleZoomByEvent (makVre::DtVreMessage *msg) |
| virtual void | onViewMagnificationChanged (double mag) |
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 Attributes | |
| double | myMaxViewMagnification |
| makVrv::DtVirtualRealityDriver * | myVrDriver |
| bool | myMrWasActive |
| bool | myHmdSmoothingEnabled |
| double | myHmdSmoothingAlpha |
| double | myHmdSmoothingThreshold |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
| makVre::DtBinocularsSimLogic::DtBinocularsSimLogic | ( | ) |
Constructor for DtBinocularsSimLogic.
Initializes the component with default zoom and smoothing settings
|
overridevirtual |
Virtual destructor for DtBinocularsSimLogic.
|
overridevirtual |
Initializes the binoculars simulation logic component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing binoculars settings |
Reads configuration values for maximum view magnification and HMD smoothing settings, registers message handlers, and sets up attribute callbacks
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization after all components are initialized.
Sets up VR-specific configurations if applicable, including configuring the VR driver's orientation smoothing settings
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Called every frame to update the component state.
| dt | Delta time since the last frame in seconds |
Current implementation is empty as updates occur through message handlers and attribute change callbacks
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the binoculars simulation logic component.
Removes message handlers and attribute change callbacks
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
virtual |
Handles zoom-to messages for binoculars.
| msg | Zoom-to message |
Sets the view magnification directly to the specified value, clamped between 1.0 and the maximum configured magnification
|
virtual |
Handles zoom-by messages for binoculars.
| msg | Zoom-by message |
Adjusts the view magnification incrementally by the specified amount, either increasing or decreasing based on the sign of the zoom value
|
virtual |
Callback for view magnification attribute changes.
| mag | New magnification value |
Updates the usingBinoculars attribute based on the current magnification and handles VR-specific state changes, including mixed reality mode management
|
protected |
Maximum allowed view magnification value.
|
protected |
Pointer to the VR driver if available.
|
protected |
Flag indicating if mixed reality was active before entering binoculars mode.
|
protected |
Flag indicating if HMD orientation smoothing is enabled.
|
protected |
Smoothing alpha parameter for HMD orientation smoothing.
|
protected |
Threshold parameter for HMD orientation smoothing in degrees per second.