|
VR-Engage
2.3
|
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< DtVreHeaderFooterUI > | myPersistentNotification |
| bool | myIsPlaying |
| bool | myIsModalOpen |
| boost::signals2::connection | myEntityRemovedConnection |
| bool | myLoadingPlayer |
| bool | myAutoRunPending |
| DtEntityIdentifier | myBaseEntityId |
| std::string | myBaseStationName |
| std::string | myBaseDisplayLayout |
| bool | myBaseSpectatorMode |
| std::string | myEmbarkedRole |
| DtEntityIdentifier | myEmbarkedHost |
| bool | myBasePlayerIsInvisible |
Protected Attributes inherited from makVre::DtPlayerStationState | |
| DtPlayerStationApp & | myApp |
| DtAttributeCallbackManager | myAttributeCallbacks |
| DtVreMessageHandlerGroup | myMessageHandlers |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtEngagedState | |
| virtual DtVreMessageResult | handleSimulationStateMessage (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleVrfSetEmbarkMessage (DtVreMessage *msg) |
| void | elementRemoved (makVrv::DtElementID elementId) |
| virtual DtVreMessageResult | handleSessionPlayState (DtVreMessage *message) |
| virtual DtVreMessageResult | handleModalState (DtVreMessage *message) |
| virtual DtVreMessageResult | handleVrfRewind (DtVreMessage *message) |
| virtual void | updatePlayerControlsState () |
| bool | isPlayerLoadInProgress () const |
| void | loadPlayer (const DtEntityIdentifier &entityId, const std::string &stationName, LoadPlayerRequestMessage::LoadPolicy loadPolicy=LoadPlayerRequestMessage::LoadPolicy_PreserveExisting, const DtEntityIdentifier &destroyEntityId=DtEntityIdentifier::nullId(), const std::string &destroyStationName=std::string(), bool isEmbarkation=false, bool isEmbarkationTransition=false) |
| void | resolveDestroyTarget (const DtEntityIdentifier &targetEntity, const std::string &targetStation, DtEntityIdentifier &outDestroyEntity, std::string &outDestroyStation) |
| void | processEmbarkationChange (const DtEntityIdentifier &newHost, const std::string &newRole) |
| std::string | resolveEmbarkedRoleFromSlot (const VrfSetEmbarkMessage *embarkMsg) |
| void | syncEmbarkationTrackingFromActivePlayer () |
| virtual DtVreMessageResult | handleAssignRolePlayer (DtVreMessage *message) |
| virtual DtVreMessageResult | handleUnassignRolePlayer (DtVreMessage *message) |
| virtual DtVreMessageResult | handleEntityRemoved (DtVreMessage *message) |
| virtual DtVreMessageResult | handleChooseRoleButtonClicked (DtVreMessage *message) |
Protected Member Functions inherited from makVre::DtPlayerStationState | |
| bool | pushState (const std::string &newState, DtPlayerStationStateArgs *args=NULL) |
| bool | popSelf () |
| bool | popUntilSelf () |
| bool | popUntilState (const std::string &parentState, DtPlayerStationStateArgs *args=NULL) |
| bool | switchToState (const std::string &newState, DtPlayerStationStateArgs *args=NULL) |
| bool | pushSelf () |
| 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::DtPlayerStationState.
|
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.