VR-Engage  2.2
Loading...
Searching...
No Matches
remoteEntityConnector.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file remoteEntityConnector.h
7//! \brief Defines the DtRemoteEntityConnector class for managing remote entity properties
8//!
9//! This connector handles manipulation of remote entities in the simulation,
10//! including visibility controls, engine sound effects, and occupant visualization.
11
12#pragma once
13
14#include "export.h"
15
18#include <boost/signals2.hpp>
19
20//! \brief Forward declaration of the exercise connection class
21class DtExerciseConn;
22
23//! \brief Forward declaration of the reflected entity list class
24class DtReflectedEntityList;
25
26//! \brief Forward declaration of the reflected entity class
27class DtReflectedEntity;
28
29namespace makVrv
30{
31//! \brief Forward declaration of the entity element class
32class DtEntityElement;
33} // namespace makVrv
34
35namespace makVre
36{
37//! \brief Connector for managing remote entity properties in the simulation
38//!
39//! DtRemoteEntityConnector handles requests to change properties of remote entities,
40//! such as visibility state, engine sound effects, and character model visualization.
41//! It works with entity elements and visualizers to modify the presentation of entities
42//! in the simulation environment.
44{
45public:
46 //! \brief Default constructor
47 //!
48 //! Initializes the connector with name "RemoteEntity"
50
51 //! \brief Virtual destructor
52 virtual ~DtRemoteEntityConnector() override;
53
54 //! \brief Installs the remote entity connector with the application and connection
55 //! \param app Pointer to the player station application
56 //! \param connection Pointer to the protocol-specific VR-Link connection
57 //!
58 //! Registers message handlers for entity visibility, occupant visibility, and engine sounds,
59 //! and connects to the element created signal to handle entity visualization issues
60 virtual void install(
61 DtPlayerStationApp* app, makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection* connection) override;
62
63 //! \brief Performs periodic processing (currently does nothing)
64 virtual void tick() override;
65
66 //! \brief Shuts down the remote entity connector
67 //!
68 //! Removes all message handlers and disconnects from the element created signal
69 virtual void shutdown() override;
70
71protected:
72 //! \brief Handles requests to change entity visibility
73 //! \param msg Pointer to the entity visibility message
74 //! \return Message result indicating how the message was handled
75 //!
76 //! Processes SetEntityVisiblityMessage by finding the entity element and
77 //! modifying its character model agent's visibility
79
80 //! \brief Handles requests to enable/disable entity engine sounds
81 //! \param msg Pointer to the entity engine sound message
82 //! \return Message result indicating how the message was handled
83 //!
84 //! Processes SetEntityEngineSoundEnabledMessage by finding the entity element
85 //! and modifying its audio visualizer's engine sound state
87
88 //! \brief Handles requests to hide entity occupants locally
89 //! \param msg Pointer to the hide occupants message
90 //! \return Message result indicating how the message was handled
91 //!
92 //! Processes SetHideEntityOccupantsLocallyMessage by finding the entity
93 //! and setting its occupants visibility state
95
96 //! \brief Handles entity element creation events
97 //! \param element Pointer to the newly created entity element
98 //!
99 //! Called when a new entity element is created, ensures proper visualization
100 //! for elements that are initially not visible
101 virtual void handleElementCreated(makVrv::DtEntityElement* element);
102
103protected:
104 //! \brief Connection to the element created signal
105 //!
106 //! Used to receive notifications when new entity elements are created
107 boost::signals2::scoped_connection myElementCreatedConnection;
108};
109} // namespace makVre
Base class for all simulation event connectors in VREngage.
Definition simEventConnector.h:54
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
virtual void tick() override
Performs periodic processing (currently does nothing)
virtual makVre::DtVreMessageResult handleEntityVisibility(makVre::DtVreMessage *msg)
Handles requests to change entity visibility.
virtual void shutdown() override
Shuts down the remote entity connector.
virtual makVre::DtVreMessageResult handleHideEntityOccupantsLocally(makVre::DtVreMessage *msg)
Handles requests to hide entity occupants locally.
virtual makVre::DtVreMessageResult handleEntityEngineSound(makVre::DtVreMessage *msg)
Handles requests to enable/disable entity engine sounds.
virtual void handleElementCreated(makVrv::DtEntityElement *element)
Handles entity element creation events.
DtRemoteEntityConnector()
Default constructor.
boost::signals2::scoped_connection myElementCreatedConnection
Connection to the element created signal.
Definition remoteEntityConnector.h:107
virtual void install(DtPlayerStationApp *app, makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection *connection) override
Installs the remote entity connector with the application and connection.
virtual ~DtRemoteEntityConnector() override
Virtual destructor.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Defines export macros and protocol namespace for vrePlayerStationConnector.
#define VRL_DLL
Empty definition for non-Windows platforms.
Definition export.h:52
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
Defines the base DtSimEventConnector class for VREngage simulation events.
Defines the base class for all VREngage messages.