|
VR-Engage
2.2
|
DtMixedRealityUpdater integrates camera video feeds with the virtual environment to create a mixed reality experience. It manages a masking object that blends real-world camera imagery with virtual content, handles chroma keying for green screen effects, and provides UI controls for adjusting mixed reality parameters.
#include <mixedRealityUpdater.h>
Public Member Functions | |
| DtMixedRealityUpdater () | |
| virtual | ~DtMixedRealityUpdater () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
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 | updateMask () |
| virtual void | handleReloadShader () |
| virtual makVre::DtVreMessageResult | handleMenuActionMessage (makVre::DtVreMessage *msg) |
| virtual void | setCockpitControlsVisible (bool visible) |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| makVrv::DtObserver * | myObserver |
| makVrv::DtVirtualRealityDriver * | myVrDriver |
| osg::ref_ptr< osg::MatrixTransform > | myMaskTransform |
| osg::ref_ptr< osg::Program > | myMaskShader |
| DtVector | myMaskColor |
| int | myAlgorithm |
| float | myA |
| float | myB |
| float | myC |
| float | myD |
| float | ix |
| float | iy |
| float | iz |
| float | ip |
| bool | myShowCameraMenu |
| std::string | myMaskPath |
| bool | myStickNeedsSwitch |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtMixedRealityUpdater::DtMixedRealityUpdater | ( | ) |
Constructor for DtMixedRealityUpdater.
Initializes component state with default values
|
overridevirtual |
Virtual destructor for DtMixedRealityUpdater.
|
overridevirtual |
Initializes the mixed reality updater component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing mixed reality settings |
Reads configuration parameters for the mixed reality system, including masking algorithm settings, color parameters, and camera projection geometry path
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization after all components are initialized.
Acquires the VR driver, sets up the masking object, and starts the mixed reality system
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Called every frame to update the mixed reality state.
| dt | Delta time since the last frame in seconds |
Handles cockpit control visibility on first update and processes UI interactions for mixed reality parameter adjustments
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the mixed reality updater component.
Disables mixed reality mode, removes the mask object, disconnects signals, and restores cockpit control visibility
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the component type identifier.
Implements makVre::DtPlayerComponent.
|
protectedvirtual |
Updates the mask transform and shader parameters.
Called each frame to update the mask transform based on the observer's position and orientation, and to update shader parameters for chroma keying
|
protectedvirtual |
Handles shader reload requests.
Reloads the mask shader files and updates the state set with the new shader
|
protectedvirtual |
Handles menu action messages for mixed reality controls.
| msg | The menu action message |
Processes menu actions, currently supporting toggling the AR camera menu
|
protectedvirtual |
Sets the visibility of cockpit controls.
| visible | True to show cockpit controls, false to hide them |
Manipulates the entity's appearance to show or hide virtual cockpit controls, typically hiding them when in mixed reality mode to see real controls
|
protected |
Pointer to the observer used for positioning the mask.
|
protected |
Pointer to the virtual reality driver that provides camera integration.
|
protected |
Transform node for the masking geometry.
|
protected |
Shader program used for blending camera imagery with virtual content.
|
protected |
Color used for chroma keying (typically green for green screen)
|
protected |
Selected chroma keying algorithm (0-4 for different methods)
|
protected |
First algorithm parameter, meaning varies by algorithm type.
|
protected |
Second algorithm parameter, meaning varies by algorithm type.
|
protected |
Third algorithm parameter, meaning varies by algorithm type.
|
protected |
Fourth algorithm parameter, meaning varies by algorithm type.
|
protected |
Camera X offset in millimeters.
|
protected |
Camera Y offset in millimeters.
|
protected |
Camera Z offset in millimeters.
|
protected |
Camera pitch offset in degrees.
|
protected |
Flag indicating whether to show the camera adjustment menu.
|
protected |
Path to the camera projection geometry (mask model)
|
protected |
Flag indicating if cockpit controls visibility needs to be toggled.