VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtNetworkConnectedState Class Reference

Detailed Description

DtNetworkConnectedState represents the application state when VR-Engage is connected to a networked simulation. It manages resource loading, network communications, and transitions between sub-states like role selection and entity engagement. This state contains most of the active gameplay functionality of the application.

#include <networkConnectedState.h>

Inheritance diagram for makVre::DtNetworkConnectedState:
[legend]

Public Member Functions

 DtNetworkConnectedState (DtPlayerStationApp &app)
 
virtual ~DtNetworkConnectedState () override
 
virtual void onEnter () override
 
virtual void onExit () override
 
virtual void onStacked () override
 
virtual void onExposed () override
 
virtual void tick (double dt) override
 
virtual void debugVortexCallback ()
 
- Public Member Functions inherited from makVre::DtPlayerStationState
 DtPlayerStationState (DtPlayerStationApp &app, std::string stateType)
 
virtual ~DtPlayerStationState ()
 
 DtPlayerStationState (const DtPlayerStationState &)=delete
 
DtPlayerStationStateoperator= (const DtPlayerStationState &)=delete
 
virtual void onEnter (const DtPlayerStationStateArgs *args)
 
virtual void onExposed (const DtPlayerStationStateArgs *args)
 
bool active () const
 
bool exposed () const
 
bool exiting () const
 
bool stacking () const
 
const std::string & stateType () const
 
DtPlayerStationAppapp () const
 

Protected Member Functions

virtual DtVreMessageResult handleStopConnection (DtVreMessage *msg)
 
virtual DtVreMessageResult handleNetworkDisconnected (DtVreMessage *msg)
 
virtual DtVreMessageResult handleSmsLoadComplete (DtVreMessage *msg)
 
virtual DtVreMessageResult handleVisualModelDefinitionsLoaded (DtVreMessage *msg)
 
- 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 ()
 

Protected Attributes

std::string myDriverName
 
std::shared_ptr< DtVreLoadingPagemyLoadingPage
 
int mySmsLoadStatusBits
 
- Protected Attributes inherited from makVre::DtPlayerStationState
DtPlayerStationAppmyApp
 

Constructor & Destructor Documentation

◆ DtNetworkConnectedState()

makVre::DtNetworkConnectedState::DtNetworkConnectedState ( DtPlayerStationApp & app)

Constructor.

Parameters
appReference to the player station application

Creates a new network connected state associated with the given application. This state is typically entered after a successful network connection.

References makVre::DtPlayerStationState::app().

◆ ~DtNetworkConnectedState()

virtual makVre::DtNetworkConnectedState::~DtNetworkConnectedState ( )
overridevirtual

Virtual destructor.

Ensures proper cleanup of network connected state resources.

Member Function Documentation

◆ onEnter()

virtual void makVre::DtNetworkConnectedState::onEnter ( )
overridevirtual

Called when the state is entered.

Initializes network-related resources, registers message handlers, and begins loading simulation resources like model sets and entity definitions. This is called when a network connection is established.

Reimplemented from makVre::DtPlayerStationState.

◆ onExit()

virtual void makVre::DtNetworkConnectedState::onExit ( )
overridevirtual

Called when the state is exited.

Cleans up resources, disconnects from the network, and unregisters message handlers. This is called when disconnecting from the network or shutting down the application.

Reimplemented from makVre::DtPlayerStationState.

◆ onStacked()

virtual void makVre::DtNetworkConnectedState::onStacked ( )
overridevirtual

Called when another state is pushed on top of this one.

Handles adjustments needed when this state is covered by another state on the stack, such as pausing certain network operations or UI updates.

Reimplemented from makVre::DtPlayerStationState.

◆ onExposed()

virtual void makVre::DtNetworkConnectedState::onExposed ( )
overridevirtual

Called when the state becomes the topmost state again.

Restores functionality when this state is exposed after another state has been popped from the stack, resuming network operations and updates.

Reimplemented from makVre::DtPlayerStationState.

◆ tick()

virtual void makVre::DtNetworkConnectedState::tick ( double dt)
overridevirtual

Updates the state each frame.

Parameters
dtTime in seconds since the last update

Handles per-frame processing in the connected state, including monitoring resource loading progress, processing network events, and updating UI elements as needed.

Reimplemented from makVre::DtPlayerStationState.

◆ debugVortexCallback()

virtual void makVre::DtNetworkConnectedState::debugVortexCallback ( )
virtual

Invokes Vortex debug callbacks.

Used for debugging physics simulation (Vortex) related functionality. This is typically only called during development and testing.

◆ handleStopConnection()

virtual DtVreMessageResult makVre::DtNetworkConnectedState::handleStopConnection ( DtVreMessage * msg)
protectedvirtual

Message handlers.

Handles messages requesting to stop the network connection

Parameters
msgPointer to the stop connection message
Returns
Message handling result

Processes requests to voluntarily disconnect from the network, typically initiated by the user or another part of the application.

◆ handleNetworkDisconnected()

virtual DtVreMessageResult makVre::DtNetworkConnectedState::handleNetworkDisconnected ( DtVreMessage * msg)
protectedvirtual

Handles network disconnection messages.

Parameters
msgPointer to the network disconnected message
Returns
Message handling result

Processes notifications that the network connection has been lost, transitioning to an appropriate state to handle the disconnection.

◆ handleSmsLoadComplete()

virtual DtVreMessageResult makVre::DtNetworkConnectedState::handleSmsLoadComplete ( DtVreMessage * msg)
protectedvirtual

Handles SMS load completion messages.

Parameters
msgPointer to the SMS load complete message
Returns
Message handling result

Processes notifications that Simulation Model Sets (SMS) have finished loading, updating the application state accordingly.

◆ handleVisualModelDefinitionsLoaded()

virtual DtVreMessageResult makVre::DtNetworkConnectedState::handleVisualModelDefinitionsLoaded ( DtVreMessage * msg)
protectedvirtual

Handles visual model definitions loaded messages.

Parameters
msgPointer to the visual model definitions loaded message
Returns
Message handling result

Processes notifications that visual model definitions have finished loading, which is a prerequisite for proper entity visualization.

Member Data Documentation

◆ myDriverName

std::string makVre::DtNetworkConnectedState::myDriverName
protected

Name of the network driver being used.

Identifies which network protocol driver (e.g., DIS, HLA) is currently active.

◆ myLoadingPage

std::shared_ptr<DtVreLoadingPage> makVre::DtNetworkConnectedState::myLoadingPage
protected

Shared pointer to the loading page UI.

Provides the user interface for displaying loading progress while resources are being loaded in the background.

◆ mySmsLoadStatusBits

int makVre::DtNetworkConnectedState::mySmsLoadStatusBits
protected

Bitmask tracking the status of SMS resource loading.

Used to track which specific resource types have completed loading, allowing the application to determine when all required resources are ready.


The documentation for this class was generated from the following file: