|
VR-Engage
2.2
|
This class shows how to extend VR-Engage's built-in DtEngagedState with custom functionality. It demonstrates proper integration with the Qt framework, state lifecycle management, and VR-Engage message handling patterns.
Key patterns demonstrated:
This is a REUSABLE pattern for any custom player station state that needs to:
#include <extendedEngagedState.h>
Protected Attributes | |
| DtExampleChatWindow * | myChatWindow |
Protected Attributes inherited from makVre::DtEngagedState | |
| std::shared_ptr< DtPlayerStationPersistentNotification > | myPersistentNotification |
| bool | myIsPlaying |
| bool | myIsModalOpen |
| boost::signals2::connection | myEntityRemovedConnection |
| std::string | myBasePlayerEmbarkedRole |
| DtEntityIdentifier | myBasePlayerHost |
| bool | myBasePlayerIsInvisible |
| bool | myOhMySomethingHasChanged |
Protected Attributes inherited from makVre::DtPlayerStationState | |
| DtPlayerStationApp & | myApp |
| makVre::DtExtendedEngagedState::DtExtendedEngagedState | ( | DtPlayerStationApp & | app | ) |
Constructs the extended engaged state.
| app | The player station application instance managing this state |
References makVre::DtPlayerStationState::app().
|
overridevirtual |
Destructor for cleanup of state resources.
|
overridevirtual |
Called when transitioning into this state.
This override demonstrates the proper pattern for state initialization:
| args | Optional state transition arguments |
Reimplemented from makVre::DtEngagedState.
|
overridevirtual |
Called when transitioning out of this state.
This override demonstrates proper cleanup patterns:
Reimplemented from makVre::DtEngagedState.
|
overridevirtual |
Called each frame while this state is active.
| dt | Delta time in seconds since last tick |
Reimplemented from makVre::DtEngagedState.
|
overridevirtual |
Called when this state becomes the active state after being stacked.
This demonstrates showing UI elements when the state becomes visible again.
Reimplemented from makVre::DtEngagedState.
|
overridevirtual |
Called when another state is pushed on top of this state.
This demonstrates hiding UI elements when the state is no longer visible.
Reimplemented from makVre::DtEngagedState.
|
virtual |
Handles incoming text messages from the simulation.
This method demonstrates the VR-Engage message handler pattern:
| message | The VR-Engage message to handle |
|
protected |
Custom Qt Quick chat window managed by this state.
Lifecycle: Created on first onEnter, reused on subsequent enters. The state is responsible for showing/hiding this window appropriately.