VR-Engage  2.3
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 a VR-Link connection.
55 //!
56 //! \param connection Non-owning 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(makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection* connection) override;
61
62 //! \brief Shuts down the remote entity connector
63 //!
64 //! Removes all message handlers and disconnects from the element created signal
65 virtual void shutdown() override;
66
67protected:
68 //! \brief Handles requests to change entity visibility
69 //! \param msg Pointer to the entity visibility message
70 //! \return Message result indicating how the message was handled
71 //!
72 //! Processes SetEntityVisiblityMessage by finding the entity element and
73 //! modifying its character model agent's visibility
75
76 //! \brief Handles requests to enable/disable entity engine sounds
77 //! \param msg Pointer to the entity engine sound message
78 //! \return Message result indicating how the message was handled
79 //!
80 //! Processes SetEntityEngineSoundEnabledMessage by finding the entity element
81 //! and modifying its audio visualizer's engine sound state
83
84 //! \brief Handles requests to hide entity occupants locally
85 //! \param msg Pointer to the hide occupants message
86 //! \return Message result indicating how the message was handled
87 //!
88 //! Processes SetHideEntityOccupantsLocallyMessage by finding the entity
89 //! and setting its occupants visibility state
91
92 //! \brief Handles entity element creation events
93 //! \param element Pointer to the newly created entity element
94 //!
95 //! Called when a new entity element is created, ensures proper visualization
96 //! for elements that are initially not visible
97 virtual void handleElementCreated(makVrv::DtEntityElement* element);
98
99protected:
100 //! \brief Connection to the element created signal
101 //!
102 //! Used to receive notifications when new entity elements are created
103 boost::signals2::scoped_connection myElementCreatedConnection;
104};
105} // namespace makVre
Base class for all simulation event connectors in VREngage.
Definition simEventConnector.h:53
virtual makVre::DtVreMessageResult handleEntityVisibility(makVre::DtVreMessage *msg)
Handles requests to change entity visibility.
virtual void install(makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection *connection) override
Installs the remote entity connector with a VR-Link connection.
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:103
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
!
Definition glsVreMessageUtil.h:50
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.